[−][src]Trait pl_lens::Lens
A lens offers a purely functional means to access and/or modify a field that is nested in an immutable data structure.
Associated Types
type Source
The lens source type, i.e., the object containing the field.
type Target
The lens target type, i.e., the field to be accessed or modified.
Required methods
fn path(&self) -> LensPath
Returns a LensPath
that describes the target of this lens relative to its source.
Provided methods
fn set(&self, source: Self::Source, target: Self::Target) -> Self::Source
Sets the target of the lens and returns the new state of the source. (This consumes the source.)
Implementations on Foreign Types
impl<L: Lens + ?Sized> Lens for Box<L>
[src]
type Source = L::Source
type Target = L::Target
fn path(&self) -> LensPath
[src]
fn mutate<'a>(&self, source: &'a mut L::Source, target: L::Target)
[src]
Implementors
impl<LHS, RHS> Lens for ComposedLens<LHS, RHS> where
LHS: RefLens,
LHS::Target: 'static,
RHS: Lens<Source = LHS::Target>,
[src]
LHS: RefLens,
LHS::Target: 'static,
RHS: Lens<Source = LHS::Target>,