pub struct CountGhost<T, const TOTAL: u64 = 2> { /* private fields */ }Implementations§
Source§impl<T, const TOTAL: u64> CountGhost<T, TOTAL>
impl<T, const TOTAL: u64> CountGhost<T, TOTAL>
Sourcepub open spec fn valid(self, id: Loc, frac: int) -> bool
pub open spec fn valid(self, id: Loc, frac: int) -> bool
{
&&& self.id() == id
&&& self.frac() == frac
}Sourcepub proof fn new(v: T) -> tracked result : Self
pub proof fn new(v: T) -> tracked result : Self
requires
TOTAL > 0,ensuresresult.frac() == TOTAL as int,result@ == v,Sourcepub proof fn agree(tracked &self, tracked other: &Self)
pub proof fn agree(tracked &self, tracked other: &Self)
requires
self.id() == other.id(),ensuresself@ == other@,Sourcepub proof fn split(tracked &mut self, n: int) -> tracked result : Self
pub proof fn split(tracked &mut self, n: int) -> tracked result : Self
requires
0 < n < old(self).frac(),ensuresresult.id() == final(self).id(),final(self).id() == old(self).id(),final(self)@ == old(self)@,result@ == old(self)@,final(self).frac() + result.frac() == old(self).frac(),result.frac() == n,Sourcepub proof fn combine(tracked &mut self, tracked other: Self)
pub proof fn combine(tracked &mut self, tracked other: Self)
requires
old(self).id() == other.id(),ensuresfinal(self).id() == old(self).id(),final(self)@ == old(self)@,final(self)@ == other@,final(self).frac() == old(self).frac() + other.frac(),Sourcepub proof fn update(tracked &mut self, v: T)
pub proof fn update(tracked &mut self, v: T)
requires
old(self).frac() == TOTAL,ensuresfinal(self).id() == old(self).id(),final(self)@ == v,final(self).frac() == old(self).frac(),Sourcepub proof fn update_with(tracked &mut self, tracked other: &mut Self, v: T)
pub proof fn update_with(tracked &mut self, tracked other: &mut Self, v: T)
requires
old(self).id() == old(other).id(),old(self).frac() + old(other).frac() == TOTAL,ensuresfinal(self).id() == old(self).id(),final(other).id() == old(other).id(),final(self).frac() == old(self).frac(),final(other).frac() == old(other).frac(),old(self)@ == old(other)@,final(self)@ == v,final(other)@ == v,Auto Trait Implementations§
impl<T, const TOTAL: u64> Freeze for CountGhost<T, TOTAL>
impl<T, const TOTAL: u64> RefUnwindSafe for CountGhost<T, TOTAL>where
T: RefUnwindSafe,
impl<T, const TOTAL: u64> Send for CountGhost<T, TOTAL>where
T: Send,
impl<T, const TOTAL: u64> Sync for CountGhost<T, TOTAL>where
T: Sync,
impl<T, const TOTAL: u64> Unpin for CountGhost<T, TOTAL>where
T: Unpin,
impl<T, const TOTAL: u64> UnsafeUnpin for CountGhost<T, TOTAL>
impl<T, const TOTAL: u64> UnwindSafe for CountGhost<T, TOTAL>where
T: UnwindSafe,
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