Skip to main content

modify

Function modify 

Source
pub fn modify<L: RefLens, F>(lens: &L, source: L::Source, f: F) -> L::Source
where F: Fn(&L::Target) -> L::Target,
Expand description

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.)