Struct vstd::atomic::PAtomicBool
source · pub struct PAtomicBool { /* private fields */ }
Implementations§
source§impl PAtomicBool
impl PAtomicBool
sourcepub const exec fn new(i: bool) -> res : (PAtomicBool, Tracked<PermissionBool>)
pub const exec fn new(i: bool) -> res : (PAtomicBool, Tracked<PermissionBool>)
ensures
equal(
res.1@.view(),
PermissionDataBool {
patomic: res.0.id(),
value: i,
},
),
sourcepub exec fn load(&self, Tracked(perm): Tracked<&PermissionBool>) -> ret : bool
pub exec fn load(&self, Tracked(perm): Tracked<&PermissionBool>) -> ret : bool
requires
equal(self.id(), perm.view().patomic),
ensuresequal(perm.view().value, ret),
sourcepub exec fn store(&self, Tracked(perm): Tracked<&mut PermissionBool>, v: bool)
pub exec fn store(&self, Tracked(perm): Tracked<&mut PermissionBool>, v: bool)
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(perm.view().value, v) && equal(self.id(), perm.view().patomic),
sourcepub exec fn compare_exchange(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
current: bool,
new: bool
) -> ret : Result<bool, bool>
pub exec fn compare_exchange( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, current: bool, new: bool ) -> ret : Result<bool, bool>
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(self.id(), perm.view().patomic)
&& match ret {
Result::Ok(r) => {
current == old(perm).view().value && equal(perm.view().value, new)
&& equal(r, old(perm).view().value)
}
Result::Err(r) => {
current != old(perm).view().value
&& equal(perm.view().value, old(perm).view().value)
&& equal(r, old(perm).view().value)
}
},
sourcepub exec fn compare_exchange_weak(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
current: bool,
new: bool
) -> ret : Result<bool, bool>
pub exec fn compare_exchange_weak( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, current: bool, new: bool ) -> ret : Result<bool, bool>
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(self.id(), perm.view().patomic)
&& match ret {
Result::Ok(r) => {
current == old(perm).view().value && equal(perm.view().value, new)
&& equal(r, old(perm).view().value)
}
Result::Err(r) => {
equal(perm.view().value, old(perm).view().value)
&& equal(r, old(perm).view().value)
}
},
sourcepub exec fn swap(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
v: bool
) -> ret : bool
pub exec fn swap( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, v: bool ) -> ret : bool
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(perm.view().value, v) && equal(old(perm).view().value, ret)
&& equal(self.id(), perm.view().patomic),
sourcepub exec fn into_inner(self, Tracked(perm): Tracked<PermissionBool>) -> ret : bool
pub exec fn into_inner(self, Tracked(perm): Tracked<PermissionBool>) -> ret : bool
requires
equal(self.id(), perm.view().patomic),
ensuresequal(perm.view().value, ret),
sourcepub exec fn fetch_and(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
n: bool
) -> ret : bool
pub exec fn fetch_and( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, n: bool ) -> ret : bool
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret) && perm.view().patomic == old(perm).view().patomic
&& perm.view().value == (old(perm).view().value && n),
sourcepub exec fn fetch_or(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
n: bool
) -> ret : bool
pub exec fn fetch_or( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, n: bool ) -> ret : bool
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret) && perm.view().patomic == old(perm).view().patomic
&& perm.view().value == (old(perm).view().value || n),
sourcepub exec fn fetch_xor(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
n: bool
) -> ret : bool
pub exec fn fetch_xor( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, n: bool ) -> ret : bool
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret) && perm.view().patomic == old(perm).view().patomic
&& perm.view().value
== ((old(perm).view().value && !n) || (!old(perm).view().value && n)),
sourcepub exec fn fetch_nand(
&self,
verus_tmp_perm: Tracked<&mut PermissionBool>,
n: bool
) -> ret : bool
pub exec fn fetch_nand( &self, verus_tmp_perm: Tracked<&mut PermissionBool>, n: bool ) -> ret : bool
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret) && perm.view().patomic == old(perm).view().patomic
&& perm.view().value == !(old(perm).view().value && n),
Auto Trait Implementations§
impl RefUnwindSafe for PAtomicBool
impl Send for PAtomicBool
impl Sync for PAtomicBool
impl Unpin for PAtomicBool
impl UnwindSafe for PAtomicBool
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