pub enum Error {
Merge(Error),
Other(Box<dyn Error + Send + Sync + 'static>),
}Expand description
Error returned by Dfs.
§Example
use std::io;
let err = Error::Merge(module::merge::Error::collision());
assert_eq!(format!("{err}"), "value collision");
assert_eq!(format!("{err:#}"), "value collision");
let err = Error::other(io::Error::other("invalid data"));
assert_eq!(format!("{err}"), "invalid data");
assert_eq!(format!("{err:#}"), "other error");Variants§
Merge(Error)
An error during the Merge operation.
Other(Box<dyn Error + Send + Sync + 'static>)
An error during some other operation during evaluation.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_merge(&self) -> bool
pub fn is_merge(&self) -> bool
Check whether the error is a merge error.
Equivalent to: matches!(self, Self::Merge(_)).
Sourcepub fn as_merge_mut(&mut self) -> Option<&mut Error>
pub fn as_merge_mut(&mut self) -> Option<&mut Error>
Get a mutable reference to the inner merge error.
Sourcepub fn is_other(&self) -> bool
pub fn is_other(&self) -> bool
Check whether the error is of another kind.
Equivalent to: matches!(self, Self::Other(_)).
Sourcepub fn as_other_mut(&mut self) -> Option<&mut (dyn Error + 'static)>
pub fn as_other_mut(&mut self) -> Option<&mut (dyn Error + 'static)>
Get a mutable reference to the inner error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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