IntoOption

Trait IntoOption 

Source
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§

Source

fn into_option(self) -> Option<T>

Implementations on Foreign Types§

Source§

impl IntoOption<Value> for &str

Source§

impl IntoOption<Value> for Cow<'_, str>

Source§

impl IntoOption<Value> for String

Source§

impl IntoOption<String> for &str

Source§

impl IntoOption<String> for &String

Source§

impl IntoOption<String> for &mut str

Source§

impl IntoOption<String> for Cow<'_, str>

Source§

impl IntoOption<String> for Box<str>

Source§

impl IntoOption<String> for Arc<str>

Source§

impl IntoOption<PathBuf> for Cow<'_, Path>

Source§

impl IntoOption<PathBuf> for Box<Path>

Source§

impl<T> IntoOption<T> for Option<T>

Source§

impl<T: ?Sized + AsRef<OsStr>> IntoOption<PathBuf> for &T

Implementors§

Source§

impl<T> IntoOption<T> for T