pub trait IntoOption<T> {
// Required method
fn into_option(self) -> Option<T>;
}Expand description
Utility trait for builder methods for optional values.
This allows the caller to either pass in the value itself without wrapping it in Some,
or to just pass in an Option if that is what they have.
Required Methods§
Sourcefn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".