pub enum Error {
Library {
status: Status,
message: String,
},
Other {
code: i32,
message: String,
},
Argument {
message: String,
},
}Expand description
A failed call. The message is seams_handle_error when the call had a handle.
let mut system = seams::System::new()?;
let err = system
.chill_plus(&seams::ChillOptions::default())
.expect_err("an empty frame has no coordinates");
assert_eq!(err.status(), Some(seams::Status::State));
assert!(!err.message().is_empty());Variants§
Library
The library rejected the call with a known status.
Other
The library returned a status this crate does not name.
Argument
The argument cannot be passed to the C API.
Implementations§
Source§impl Error
impl Error
Sourcepub fn status(&self) -> Option<Status>
pub fn status(&self) -> Option<Status>
Status when the failure came from the library and the code is known.
let err = seams::nframes("\0").expect_err("a nul cannot be a path");
assert_eq!(err.status(), None);
assert_eq!(err.code(), seams_sys::SEAMS_ERR_ARG);Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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