pub trait Setter<T>: Optics<T>{
// Required method
fn over(&self, s: &mut T, f: &mut dyn FnMut(&mut Self::View));
// Provided method
fn set_cloned(&self, a: &Self::View, s: &mut T)
where Self::View: Clone { ... }
}
Expand description
Setter.
Required Methods§
Provided Methods§
sourcefn set_cloned(&self, a: &Self::View, s: &mut T)
fn set_cloned(&self, a: &Self::View, s: &mut T)
Apply a setter.
§Note
The value to be set is cloned, because we don’t know the exact number of holes to be filled
in. If the optics has a stricter interface (i.e., it also implements AffineTraversal
),
use AffineTraversal::set
instead.