pub struct LensComposer;Expand description
LensComposer provides utilities for composing lenses and verifying laws.
Implementations§
Source§impl LensComposer
impl LensComposer
Sourcepub fn compose<S, M, A>(
outer: Lens<S, M>,
inner: Lens<M, A>,
) -> impl Fn(&S) -> A
pub fn compose<S, M, A>( outer: Lens<S, M>, inner: Lens<M, A>, ) -> impl Fn(&S) -> A
Compose two lenses: outer focuses on M inside S,
inner focuses on A inside M.
Sourcepub fn check_get_set<S, A>(lens: &Lens<S, A>, s: S) -> bool
pub fn check_get_set<S, A>(lens: &Lens<S, A>, s: S) -> bool
Check the GetSet law: set(get(s), s) == s.
Sourcepub fn check_set_get<S, A>(lens: &Lens<S, A>, a: A, s: S) -> bool
pub fn check_set_get<S, A>(lens: &Lens<S, A>, a: A, s: S) -> bool
Check the SetGet law: get(set(a, s)) == a.
Auto Trait Implementations§
impl Freeze for LensComposer
impl RefUnwindSafe for LensComposer
impl Send for LensComposer
impl Sync for LensComposer
impl Unpin for LensComposer
impl UnsafeUnpin for LensComposer
impl UnwindSafe for LensComposer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more