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

pub trait PartialLens: Clone {
    type From;
    type To;
    fn try_get(&self, s: &Self::From) -> Option<Arc<Self::To>>;
fn try_put<Convert>(
        &self,
        v: Option<Convert>,
        s: &Self::From
    ) -> Option<Self::From>
    where
        Convert: Shared<Self::To>
; 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 if 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