Trait im::lens::PartialLens [] [src]

pub trait PartialLens: Clone {
    type From;
    type To;
    fn try_get<R>(&self, s: R) -> Option<Arc<Self::To>>
    where
        R: AsRef<Self::From>
; fn try_put<Convert, R>(
        &self,
        v: Option<Convert>,
        s: R
    ) -> Option<Self::From>
    where
        R: AsRef<Self::From>,
        Arc<Self::To>: From<Convert>
; fn try_chain<L, Next>(
        &self,
        next: &L
    ) -> Compose<Self::From, Self::To, Next, Self, L>
    where
        L: PartialLens<From = Self::To, To = Next>
, { ... } }

A lens from From to To where the focus of the lens isn't guaranteed to exist inside From. Operations on these lenses therefore return Options.

Associated Types

Required Methods

Get the focus of the lens, if available.

Put a value into the lens, returning the updated From value is the operation succeeded.

Provided Methods

Compose this lens with a lens from To to a new type Next, yielding a lens from From to Next.

Implementors