Trait owner_monad::OwnerOnce[][src]

pub trait OwnerOnce<T> {
    fn with<U>(self, f: impl FnOnce(T) -> U) -> Option<U>;
}

A monad which conditionally provides access to a T value.

This is included alongside Owner and OwnerMut for completeness, but this trait is isomorphic to FnOnce() -> T.

Required methods

fn with<U>(self, f: impl FnOnce(T) -> U) -> Option<U>[src]

Consumes the monad, applying the given function to the contained value, if it exists.

Loading content...

Implementors

impl<T> OwnerOnce<T> for PureOwner<T>[src]

impl<T, U, OT: OwnerOnce<T>, OU: OwnerOnce<U>, F: FnOnce(T) -> OU> OwnerOnce<U> for BindOwner<T, U, OT, OU, F>[src]

Loading content...