Struct vstd::atomic::PAtomicI32
source · pub struct PAtomicI32 { /* private fields */ }
Implementations§
source§impl PAtomicI32
impl PAtomicI32
sourcepub const exec fn new(i: i32) -> res : (PAtomicI32, Tracked<PermissionI32>)
pub const exec fn new(i: i32) -> res : (PAtomicI32, Tracked<PermissionI32>)
ensures
equal(
res.1@.view(),
PermissionDataI32 {
patomic: res.0.id(),
value: i,
},
),
sourcepub exec fn load(&self, Tracked(perm): Tracked<&PermissionI32>) -> ret : i32
pub exec fn load(&self, Tracked(perm): Tracked<&PermissionI32>) -> ret : i32
requires
equal(self.id(), perm.view().patomic),
ensuresequal(perm.view().value, ret),
sourcepub exec fn store(&self, Tracked(perm): Tracked<&mut PermissionI32>, v: i32)
pub exec fn store(&self, Tracked(perm): Tracked<&mut PermissionI32>, v: i32)
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 PermissionI32>,
current: i32,
new: i32
) -> ret : Result<i32, i32>
pub exec fn compare_exchange( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, current: i32, new: i32 ) -> ret : Result<i32, i32>
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 PermissionI32>,
current: i32,
new: i32
) -> ret : Result<i32, i32>
pub exec fn compare_exchange_weak( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, current: i32, new: i32 ) -> ret : Result<i32, i32>
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 PermissionI32>, v: i32) -> ret : i32
pub exec fn swap(&self, Tracked(perm): Tracked<&mut PermissionI32>, v: i32) -> ret : i32
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<PermissionI32>) -> ret : i32
pub exec fn into_inner(self, Tracked(perm): Tracked<PermissionI32>) -> ret : i32
requires
equal(self.id(), perm.view().patomic),
ensuresequal(perm.view().value, ret),
sourcepub exec fn fetch_add_wrapping(
&self,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_add_wrapping( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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_i32(old(perm).view().value as int, n as int),
sourcepub exec fn fetch_sub_wrapping(
&self,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_sub_wrapping( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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_i32(old(perm).view().value as int, n as int),
sourcepub exec fn fetch_add(
&self,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_add( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
requires
equal(self.id(), old(perm).view().patomic),
(<i32>::MIN as int) <= old(perm).view().value + n,
old(perm).view().value + n <= (<i32>::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,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_sub( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
requires
equal(self.id(), old(perm).view().patomic),
(<i32>::MIN as int) <= old(perm).view().value - n,
old(perm).view().value - n <= <i32>::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,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_and( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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 PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_or( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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 PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_xor( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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 PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_nand( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_max( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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,
verus_tmp_perm: Tracked<&mut PermissionI32>,
n: i32
) -> ret : i32
pub exec fn fetch_min( &self, verus_tmp_perm: Tracked<&mut PermissionI32>, n: i32 ) -> ret : i32
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 !Freeze for PAtomicI32
impl RefUnwindSafe for PAtomicI32
impl Send for PAtomicI32
impl Sync for PAtomicI32
impl Unpin for PAtomicI32
impl UnwindSafe for PAtomicI32
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