pub struct PointsTo<V, const N: usize> { /* private fields */ }Expand description
Permission to access an array of values
Implementations§
Source§impl<V, const N: usize> PointsTo<V, N>
impl<V, const N: usize> PointsTo<V, N>
Sourcepub open spec fn is_pptr(self, ptr: ArrayPtr<V, N>) -> bool
pub open spec fn is_pptr(self, ptr: ArrayPtr<V, N>) -> bool
{ ptr.addr == self.addr() }Spec: cast the permission to a pointer
Sourcepub closed spec fn wf(self) -> bool
pub closed spec fn wf(self) -> bool
Spec: invariants for the ArrayPtr permissions TODO: uncomment the below if “external_type_specification: Const params not yet supported” is fixed #[verifier::type_invariant]
Sourcepub closed spec fn points_to(self) -> PointsToArray<V, N>
pub closed spec fn points_to(self) -> PointsToArray<V, N>
Sourcepub open spec fn value(self) -> Seq<V>
pub open spec fn value(self) -> Seq<V>
recommends
self.is_init_all(),{ self.points_to().value() }Sourcepub open spec fn is_init_all(self) -> bool
pub open spec fn is_init_all(self) -> bool
{ self.points_to().is_init_all() }Sourcepub open spec fn is_uninit_all(self) -> bool
pub open spec fn is_uninit_all(self) -> bool
{ self.points_to().is_uninit_all() }Sourcepub proof fn is_nonnull(tracked self)
pub proof fn is_nonnull(tracked self)
requires
self.wf(),ensuresself.addr() != 0,Sourcepub proof fn leak_contents(tracked &mut self, index: int)
pub proof fn leak_contents(tracked &mut self, index: int)
requires
old(self).wf(),ensuresself.wf(),self.addr() == old(self).addr(),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: &PointsTo<S, M>)
pub proof fn is_disjoint<S, const M: usize>(&self, other: &PointsTo<S, M>)
ensures
self.addr() + layout::size_of::<[V; N]>() <= other.addr()
|| other.addr() + layout::size_of::<[S; M]>() <= self.addr(),Sourcepub proof fn is_distinct<S, const M: usize>(&self, other: &PointsTo<S, M>)
pub proof fn is_distinct<S, const M: usize>(&self, other: &PointsTo<S, M>)
requires
layout::size_of::<[V; N]>() != 0,layout::size_of::<[S; M]>() != 0,ensuresself.addr() != other.addr(),Auto Trait Implementations§
impl<V, const N: usize> Freeze for PointsTo<V, N>
impl<V, const N: usize> RefUnwindSafe for PointsTo<V, N>where
V: RefUnwindSafe,
impl<V, const N: usize> Send for PointsTo<V, N>where
V: Send,
impl<V, const N: usize> Sync for PointsTo<V, N>where
V: Sync,
impl<V, const N: usize> Unpin for PointsTo<V, N>where
V: Unpin,
impl<V, const N: usize> UnwindSafe for PointsTo<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