pub trait OptionExt {
type Some;
// Required methods
fn ok_or_raise<A, F>(self, err: F) -> Result<Self::Some, Exn<A>>
where A: Error + Send + Sync + 'static,
F: FnOnce() -> A;
fn ok_or_raise_erased<A, F>(self, err: F) -> Result<Self::Some, Exn>
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§
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.