Trait refraction::PartialLens [] [src]

pub trait PartialLens: Lenticuloid where
    Self::AtInitial: PartialLens,
    Self::AtFinal: PartialLens
{ fn try_get_inject(
        &self,
        v: Self::InitialSource
    ) -> Result<(Self::InitialTarget, Injector<Self::FinalTarget, Self::FinalSource>), Self::FinalSource>; fn modify_with<F, X>(
        &self,
        v: Self::InitialSource,
        f: F
    ) -> (Self::FinalSource, Option<X>)
    where
        F: FnOnce(Self::InitialTarget) -> (Self::FinalTarget, X)
; fn try_get(
        &self,
        v: Self::InitialSource
    ) -> Result<Self::InitialTarget, Self::FinalSource> { ... } fn set(
        &self,
        v: Self::InitialSource,
        x: Self::FinalTarget
    ) -> Self::FinalSource { ... } fn exchange(
        &self,
        v: Self::InitialSource,
        x: Self::FinalTarget
    ) -> (Option<Self::InitialTarget>, Self::FinalSource) { ... } fn modify<F>(&self, v: Self::InitialSource, f: F) -> Self::FinalSource
    where
        F: FnOnce(Self::InitialTarget) -> Self::FinalTarget
, { ... } }

The supertype of all partial lens families.

Required Methods

This signature is somewhat hacky; it awaits resolution of the FnBox issue for better design. Notably, the injection function returned by this method will (if law-abiding) only return Some exactly once; every time afterwards, it will return None.

Provided Methods

Implementors