pub struct Committer<C: Container<Value: Sized>>(/* private fields */);Expand description
Wrapper around a single atomic operation, where multiple ghost steps can be performed.
Implementations§
Source§impl<C: Container<Value: Sized>> Committer<C>
impl<C: Container<Value: Sized>> Committer<C>
Sourcepub fn ward(self) -> C
pub fn ward(self) -> C
Identity of the committer
This is used so that we can only use the committer with the right [AtomicOwn].
logic(opaque) ⚠
Sourcepub fn old_value(self) -> C::Value
pub fn old_value(self) -> C::Value
Value held by the [AtomicOwn], before the [shoot].
logic(opaque) ⚠
Sourcepub fn new_value(self) -> C::Value
pub fn new_value(self) -> C::Value
Value held by the [AtomicOwn], after the [shoot].
logic(opaque) ⚠
Sourcepub fn shoot(&mut self, own: &mut Perm<C>)
pub fn shoot(&mut self, own: &mut Perm<C>)
‘Shoot’ the committer
This does the write on the atomic in ghost code, and can only be called once.
requires
!self.shot()requires
self.ward() == *own.ward()ensures
(^self).shot()ensures
(^own).ward() == (*own).ward()ensures
*(*own).val() == (*self).old_value()ensures
*(^own).val() == (*self).new_value()terminates
ghost
Auto Trait Implementations§
impl<C> Freeze for Committer<C>
impl<C> RefUnwindSafe for Committer<C>
impl<C> Send for Committer<C>
impl<C> Sync for Committer<C>
impl<C> Unpin for Committer<C>
impl<C> UnsafeUnpin for Committer<C>
impl<C> UnwindSafe for Committer<C>
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