pub trait UnwrapOrErr<T> {
// Required method
fn unwrap_or_err(self) -> T;
}Expand description
Returns the Ok value or the Err value. Available when the Ok and Err types are the same. This is a way to default the result using the specific Err value rather than unwrap_or_default() using Ok’s default.
Required Methods§
fn unwrap_or_err(self) -> T
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".