pub struct Snapshot<T: ?Sized>(/* private fields */);
Expand description
A copyable snapshot, usable in pearlite.
The Snapshot
type contains the logical value of some data, in a purely immutable way.
It is zero sized.
Creating a snapshot does not move the ownership of a value.
§Pearlite syntax
In executable code, you may create a snapshot with the snapshot!
macro. Inside
this macro, you may write pearlite code; this code will not run during the normal
execution of the program.
§Example
let x: Snapshot<Int> = snapshot!(1);
let m: Snapshot<Mapping<Int, Int>> = snapshot!(|x| x + 1);
Implementations§
Trait Implementations§
impl<T: ?Sized> Copy for Snapshot<T>
Auto Trait Implementations§
impl<T> Freeze for Snapshot<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for Snapshot<T>
impl<T> !Send for Snapshot<T>
impl<T> !Sync for Snapshot<T>
impl<T> !Unpin for Snapshot<T>
impl<T> !UnwindSafe for Snapshot<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> MakeSized for Twhere
T: ?Sized,
impl<T> MakeSized for Twhere
T: ?Sized,
Source§fn make_sized(&self) -> Box<T>
fn make_sized(&self) -> Box<T>
logic ⚠
ensures
*result == *self