Struct creusot_contracts::snapshot::Snapshot
source · 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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