Trait owner_monad::Owner[][src]

pub trait Owner<T: ?Sized> {
    fn with<'a, U>(&'a self, f: impl FnOnce(&T) -> U) -> Option<U>
    where
        T: 'a
; }

A monad which conditionally provides immutable access to a T value.

Required methods

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

Applies the given function to the contained value, if it exists.

Loading content...

Implementations on Foreign Types

impl<T: ?Sized> Owner<T> for Weak<T>[src]

impl<T: ?Sized> Owner<T> for Weak<T>[src]

Loading content...

Implementors

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

impl<T, U, OT: Owner<T>, OU: Owner<U>, F: Fn(&T) -> OU> Owner<U> for BindOwner<&T, U, OT, OU, F>[src]

impl<T: ?Sized, O: ?Sized + Owner<T>> Owner<T> for &O[src]

Loading content...