pub trait MaybeExt<T> {
// Required methods
fn to_result<E>(self, err: E) -> Result<T, E>;
fn try_unwrap(self) -> ComposableResult<T, &'static str>;
}Expand description
Extension trait for Maybe that provides additional error handling methods
Required Methods§
Sourcefn to_result<E>(self, err: E) -> Result<T, E>
fn to_result<E>(self, err: E) -> Result<T, E>
Converts a Maybe to a Result with the specified error
Sourcefn try_unwrap(self) -> ComposableResult<T, &'static str>
fn try_unwrap(self) -> ComposableResult<T, &'static str>
Provides a safe unwrapping mechanism that returns a Result.
On Nothing, this returns an Err containing a ComposableError<&'static str>
with context explaining the failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".