pub trait OptionExt {
type Some;
// Required methods
fn ok_or_raise<A, F>(self, err: F) -> ExnResult<Self::Some, A>
where A: Error + Send + Sync + 'static,
F: FnOnce() -> A;
fn ok_or_raise_erased<A, F>(self, err: F) -> ExnResult<Self::Some>
where A: Error + Send + Sync + 'static,
F: FnOnce() -> A;
}Expand description
An extension trait for Option to provide raising new exceptions on None.
Required Associated Types§
Required Methods§
Sourcefn ok_or_raise<A, F>(self, err: F) -> ExnResult<Self::Some, A>
fn ok_or_raise<A, F>(self, err: F) -> ExnResult<Self::Some, A>
Construct a new Exn on the None variant.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".