cushy::reactive

Trait IntoOption

Source
pub trait IntoOption<T> {
    // Required method
    fn into_option(self) -> Option<T>;
}
Expand description

A type that can be converted into an Option<T>.

This trait exists to unify how Unwrapped abstracts implementations for Result and Option. In the future, if the standard library implements Into<Option<T>> for Result<T,E>, this trait can be removed.

Required Methods§

Source

fn into_option(self) -> Option<T>

Returns self as an option.

Implementations on Foreign Types§

Source§

impl<'a, T> IntoOption<&'a T> for &'a Option<T>

Source§

impl<'a, T, E> IntoOption<&'a T> for &'a Result<T, E>

Source§

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

Source§

impl<T, E> IntoOption<T> for Result<T, E>

Implementors§