pub struct PointsToArray<V, const N: usize> { /* private fields */ }Implementations§
Source§impl<V, const N: usize> PointsToArray<V, N>
impl<V, const N: usize> PointsToArray<V, N>
Sourcepub open spec fn is_init(self, index: int) -> bool
pub open spec fn is_init(self, index: int) -> bool
{ 0 <= index < N && self.opt_value()[index].is_init() }Sourcepub open spec fn is_uninit(self, index: int) -> bool
pub open spec fn is_uninit(self, index: int) -> bool
{ 0 <= index < N && self.opt_value()[index].is_uninit() }Sourcepub open spec fn is_init_all(self) -> bool
pub open spec fn is_init_all(self) -> bool
{ is_mem_contents_all_init(self.opt_value()) }Sourcepub open spec fn is_uninit_all(self) -> bool
pub open spec fn is_uninit_all(self) -> bool
{ is_mem_contents_all_uninit(self.opt_value()) }Sourcepub open spec fn value(self) -> Seq<V>
pub open spec fn value(self) -> Seq<V>
recommends
self.is_init_all(),{
let opt_value = self.opt_value();
Seq::new(N as nat, |i: int| opt_value[i].value())
}Sourcepub proof fn leak_contents(tracked &mut self, index: int)
pub proof fn leak_contents(tracked &mut self, index: int)
ensures
self.ptr() == old(self).ptr(),self.is_uninit(index),forall |i: int| {
0 <= i < N && i != index ==> self.opt_value()[i] == old(self).opt_value()[i]
},Sourcepub proof fn is_disjoint<S, const M: usize>(&self, other: &PointsToArray<S, M>)
pub proof fn is_disjoint<S, const M: usize>(&self, other: &PointsToArray<S, M>)
ensures
self.ptr() as int + layout::size_of::<[V; N]>() <= other.ptr() as int
|| other.ptr() as int + layout::size_of::<[S; M]>() <= self.ptr() as int,Sourcepub proof fn is_disjoint_ptr<S>(&self, other: &PointsTo<S>)
pub proof fn is_disjoint_ptr<S>(&self, other: &PointsTo<S>)
ensures
self.ptr() as int + layout::size_of::<[V; N]>() <= other.ptr() as int
|| other.ptr() as int + layout::size_of::<S>() <= self.ptr() as int,Sourcepub proof fn is_nonnull(tracked &self)
pub proof fn is_nonnull(tracked &self)
requires
layout::size_of::<[V; N]>() > 0,ensuresself@.ptr@.addr != 0,Source§impl<V, const N: usize> PointsToArray<V, N>
impl<V, const N: usize> PointsToArray<V, N>
Sourcepub proof fn into_array(tracked pt: PointsTo<[V; N]>) -> tracked res : PointsToArray<V, N>
pub proof fn into_array(tracked pt: PointsTo<[V; N]>) -> tracked res : PointsToArray<V, N>
ensures
res@.ptr == pt@.ptr,res@.value == mem_contents_wrap(pt@.opt_value),Trait Implementations§
Auto Trait Implementations§
impl<V, const N: usize> Freeze for PointsToArray<V, N>
impl<V, const N: usize> RefUnwindSafe for PointsToArray<V, N>where
V: RefUnwindSafe,
impl<V, const N: usize> Send for PointsToArray<V, N>where
V: Send,
impl<V, const N: usize> Sync for PointsToArray<V, N>where
V: Sync,
impl<V, const N: usize> Unpin for PointsToArray<V, N>where
V: Unpin,
impl<V, const N: usize> UnwindSafe for PointsToArray<V, N>where
V: 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