feat: Context.is_key_error
(cherry picked from commit f754e243852103164dbc6fdaf8c0cccb3c85cfb1)
This commit is contained in:
parent
49576f82e4
commit
d38cf51c63
1 changed files with 4 additions and 0 deletions
|
|
@ -34,6 +34,10 @@ impl Context {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
/// NIX_ERR_KEY is returned when e.g. an attribute is missing. Return true if the error is of this type.
|
||||||
|
pub fn is_key_error(&self) -> bool {
|
||||||
|
unsafe { raw::err_code(self.inner.as_ptr()) == raw::NIX_ERR_KEY }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Context {
|
impl Drop for Context {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue