pub struct Mapping<A: ?Sized, B>(/* private fields */);Expand description
A mapping: map every value of type A to a value of type B.
§Pearlite syntax
Mappings have special support in pearlite code: you may write a closure to create a mapping.
§Example
let value = snapshot!(4);
let map: Snapshot<Mapping<Int, Int>> = snapshot!(|n| if n % 2 == 0 { 0 } else { *value });
proof_assert!(map.get(1) == 4);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<A, B> Freeze for Mapping<A, B>where
A: ?Sized,
impl<A, B> RefUnwindSafe for Mapping<A, B>
impl<A, B> Send for Mapping<A, B>
impl<A, B> Sync for Mapping<A, B>
impl<A, B> Unpin for Mapping<A, B>
impl<A, B> UnwindSafe for Mapping<A, B>
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