OptionContext

Trait OptionContext 

Source
pub trait OptionContext<T> {
    // Required method
    fn context(self, context: impl Into<String>) -> Result<T>;
}
Expand description

Extension trait for adding context to Options

Required Methods§

Source

fn context(self, context: impl Into<String>) -> Result<T>

Convert None to an error with context

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.

Implementations on Foreign Types§

Source§

impl<T> OptionContext<T> for Option<T>

Source§

fn context(self, context: impl Into<String>) -> Result<T>

Implementors§