pub trait WelpOptionExt<T>: Sized {
// Required methods
fn welp_context(self, message: impl Into<String>) -> Result<T, Welp>;
fn with_welp_context<S, F>(self, f: F) -> Result<T, Welp>
where S: Into<String>,
F: FnOnce() -> S;
}Expand description
Required Methods§
Sourcefn welp_context(self, message: impl Into<String>) -> Result<T, Welp>
fn welp_context(self, message: impl Into<String>) -> Result<T, Welp>
Convert None into a Welp with the given message.
Note: the message argument is evaluated at the call site per Rust’s
eager-argument rules — welp_context(format!(...)) allocates the
formatted String even on the Some branch. Use with_welp_context
when the message is built from a non-trivial expression that should
only run on None.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".