pub struct AtomicU32(/* private fields */);Expand description
Creusot wrapper around std::sync::atomic::AtomicU32.
Implementations§
Source§impl AtomicU32
impl AtomicU32
Sourcepub fn new(
val: u32,
view: Ghost<&mut SyncView>,
) -> (Self, Ghost<Box<Perm<AtomicU32>>>)
pub fn new( val: u32, view: Ghost<&mut SyncView>, ) -> (Self, Ghost<Box<Perm<AtomicU32>>>)
ensures
*result.1.val() == FMap::singleton(result.0.get_timestamp(^view), (val, **view))
ensures
*result.1.ward() == result.0terminates
Sourcepub fn load<F>(&self, f: Ghost<F>) -> u32
pub fn load<F>(&self, f: Ghost<F>) -> u32
Wrapper for std::sync::atomic::AtomicU32::load.
requires
forall<c: &LoadCommitter<$type, Self>> c.ward() == *self ==> f.precondition((c,))
ensures
exists<c: &LoadCommitter<$type, Self>> c.ward() == *self && c.val() == result && f.postcondition_once((c,), ())
Sourcepub fn store<F>(&self, val: u32, f: Ghost<F>)
pub fn store<F>(&self, val: u32, f: Ghost<F>)
Wrapper for std::sync::atomic::AtomicU32::store.
requires
forall<c: &mut StoreCommitter<$type, Self>> !c.shot() ==> c.ward() == *self ==> c.val() == val ==> f.precondition((c,)) && f.postcondition_once((c,), ()) ==> (^c).shot()
ensures
exists<c: &mut StoreCommitter<$type, Self>> !c.shot() && c.ward() == *self && c.val() == val && f.postcondition_once((c,), ())
Trait Implementations§
Source§impl HasTimestamp for AtomicU32
impl HasTimestamp for AtomicU32
Source§fn get_timestamp(self, _: SyncView) -> Timestamp
fn get_timestamp(self, _: SyncView) -> Timestamp
logic(opaque) ⚠
Source§fn get_timestamp_monotonic(self, x: SyncView, y: SyncView)
fn get_timestamp_monotonic(self, x: SyncView, y: SyncView)
logic(law) ⚠
requires
x.le_log(y)ensures
self.get_timestamp(x).le_log(self.get_timestamp(y))Auto Trait Implementations§
impl !Freeze for AtomicU32
impl Objective for AtomicU32
impl RefUnwindSafe for AtomicU32
impl Send for AtomicU32
impl Sync for AtomicU32
impl Unpin for AtomicU32
impl UnsafeUnpin for AtomicU32
impl UnwindSafe for AtomicU32
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