MaybeError

Trait MaybeError 

Source
pub trait MaybeError {
    // Required methods
    fn from_err(err: Box<dyn Error + Send + Sync>) -> Self;
    fn err(&self) -> Option<Box<dyn Error + Send + Sync>>;

    // Provided methods
    fn is_ok(&self) -> bool { ... }
    fn is_err(&self) -> bool { ... }
}

Required Methods§

Source

fn from_err(err: Box<dyn Error + Send + Sync>) -> Self

Construct an instance from an error.

Source

fn err(&self) -> Option<Box<dyn Error + Send + Sync>>

Construct into an error instance.

Provided Methods§

Source

fn is_ok(&self) -> bool

Check if the current instance represents a success.

Source

fn is_err(&self) -> bool

Check if the current instance represents an error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R> MaybeError for Annotated<R>
where R: for<'de> Deserialize<'de> + Serialize,