pub struct ErrorState { /* private fields */ }Expand description
The error state a file or value handle carries.
asdf_error hands out a borrowed pointer into message, so the string
must outlive the call and stay put until the next error is recorded.
Implementations§
Source§impl ErrorState
impl ErrorState
Sourcepub fn set_system(&self, errnum: i32)
pub fn set_system(&self, errnum: i32)
Record an OS-level error, deriving the message from strerror.
Sourcepub fn errno(&self) -> i32
pub fn errno(&self) -> i32
The recorded errno, meaningful only for ErrorCode::System.
Sourcepub fn message_ptr(&self) -> *const c_char
pub fn message_ptr(&self) -> *const c_char
A pointer to the recorded message, valid until the next error is set.
§Safety
The returned pointer borrows from self and is invalidated by any
later set/clear on the same state.
Trait Implementations§
Source§impl Debug for ErrorState
impl Debug for ErrorState
Source§impl Default for ErrorState
impl Default for ErrorState
Source§fn default() -> ErrorState
fn default() -> ErrorState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ErrorState
impl RefUnwindSafe for ErrorState
impl Send for ErrorState
impl Sync for ErrorState
impl Unpin for ErrorState
impl UnsafeUnpin for ErrorState
impl UnwindSafe for ErrorState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more