Crate pl_lens

Crate pl_lens 

Source

Macros§

compose_lens
Provides a shorthand for composing a series of lenses.
lens
This is a macro-based shorthand that allows us to write:

Structs§

ComposedLens
Composes two Lenses.
LensPath
Describes a lens relative to a source data structure.
LensPathElement
An element in a LensPath.

Traits§

Lens
A lens offers a purely functional means to access and/or modify a field that is nested in an immutable data structure.
RefLens
A lens that allows the target to be accessed and mutated by reference.
ValueLens
A lens that allows the target to be accessed only by cloning or copying the target value.

Functions§

compose
Composes a Lens<A, B> with another Lens<B, C> to produce a new Lens<A, C>.
modify
Modifies the target of the lens by applying a function to the current value. This consumes the source. (This lives outside the Lens trait to allow lenses to be object-safe but still allow for static dispatch on the given closure.)

Derive Macros§

Lenses
Handles the #derive(Lenses) applied to a struct by generating a Lens implementation for each field in the struct.