pub struct PAtomicU8 { /* private fields */ }
Implementations§
source§impl PAtomicU8
impl PAtomicU8
sourcepub const exec fn new(i: u8) -> res : (PAtomicU8, Tracked<PermissionU8>)
pub const exec fn new(i: u8) -> res : (PAtomicU8, Tracked<PermissionU8>)
ensures
equal(
res.1@.view(),
PermissionDataU8 {
patomic: res.0.id(),
value: i,
},
),
sourcepub exec fn load(&self, Tracked(perm): Tracked<&PermissionU8>) -> ret : u8
pub exec fn load(&self, Tracked(perm): Tracked<&PermissionU8>) -> ret : u8
requires
equal(self.id(), perm.view().patomic),
ensuresequal(perm.view().value, ret),
sourcepub exec fn store(&self, Tracked(perm): Tracked<&mut PermissionU8>, v: u8)
pub exec fn store(&self, Tracked(perm): Tracked<&mut PermissionU8>, v: u8)
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 PermissionU8>,
current: u8,
new: u8
) -> ret : Result<u8, u8>
pub exec fn compare_exchange( &self, verus_tmp_perm: Tracked<&mut PermissionU8>, current: u8, new: u8 ) -> ret : Result<u8, u8>
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 PermissionU8>,
current: u8,
new: u8
) -> ret : Result<u8, u8>
pub exec fn compare_exchange_weak( &self, verus_tmp_perm: Tracked<&mut PermissionU8>, current: u8, new: u8 ) -> ret : Result<u8, u8>
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, Tracked(perm): Tracked<&mut PermissionU8>, v: u8) -> ret : u8
pub exec fn swap(&self, Tracked(perm): Tracked<&mut PermissionU8>, v: u8) -> ret : u8
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<PermissionU8>) -> ret : u8
pub exec fn into_inner(self, Tracked(perm): Tracked<PermissionU8>) -> ret : u8
requires
equal(self.id(), perm.view().patomic),
ensuresequal(perm.view().value, ret),
sourcepub exec fn fetch_add_wrapping(
&self,
verus_tmp_perm: Tracked<&mut PermissionU8>,
n: u8
) -> ret : u8
pub exec fn fetch_add_wrapping( &self, verus_tmp_perm: Tracked<&mut PermissionU8>, n: u8 ) -> ret : u8
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret),
perm.view().patomic == old(perm).view().patomic,
perm.view().value as int == wrapping_add_u8(old(perm).view().value as int, n as int),
sourcepub exec fn fetch_sub_wrapping(
&self,
verus_tmp_perm: Tracked<&mut PermissionU8>,
n: u8
) -> ret : u8
pub exec fn fetch_sub_wrapping( &self, verus_tmp_perm: Tracked<&mut PermissionU8>, n: u8 ) -> ret : u8
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret),
perm.view().patomic == old(perm).view().patomic,
perm.view().value as int == wrapping_sub_u8(old(perm).view().value as int, n as int),
sourcepub exec fn fetch_add(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_add(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
requires
equal(self.id(), old(perm).view().patomic),
(<u8>::MIN as int) <= old(perm).view().value + n,
old(perm).view().value + n <= (<u8>::MAX as int),
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_sub(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_sub(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
requires
equal(self.id(), old(perm).view().patomic),
(<u8>::MIN as int) <= old(perm).view().value - n,
old(perm).view().value - n <= <u8>::MAX as int,
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_and(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_and(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
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, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_or(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
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, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_xor(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
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_nand(
&self,
verus_tmp_perm: Tracked<&mut PermissionU8>,
n: u8
) -> ret : u8
pub exec fn fetch_nand( &self, verus_tmp_perm: Tracked<&mut PermissionU8>, n: u8 ) -> ret : u8
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_max(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_max(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret),
perm.view().patomic == old(perm).view().patomic,
perm.view().value
== (if old(perm).view().value > n { old(perm).view().value } else { n }),
sourcepub exec fn fetch_min(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
pub exec fn fetch_min(&self, Tracked(perm): Tracked<&mut PermissionU8>, n: u8) -> ret : u8
requires
equal(self.id(), old(perm).view().patomic),
ensuresequal(old(perm).view().value, ret),
perm.view().patomic == old(perm).view().patomic,
perm.view().value
== (if old(perm).view().value < n { old(perm).view().value } else { n }),
Auto Trait Implementations§
impl RefUnwindSafe for PAtomicU8
impl Send for PAtomicU8
impl Sync for PAtomicU8
impl Unpin for PAtomicU8
impl UnwindSafe for PAtomicU8
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