pub struct PointsTo<T> { /* private fields */ }
Expand description
Permission to access possibly-initialized, typed memory.
Implementations§
source§impl<T> PointsTo<T>
impl<T> PointsTo<T>
sourcepub open spec fn opt_value(&self) -> MemContents<T>
pub open spec fn opt_value(&self) -> MemContents<T>
{ self.view().opt_value }
sourcepub proof fn is_nonnull(tracked &self)
pub proof fn is_nonnull(tracked &self)
requires
size_of::<T>() != 0,
ensuresself@.ptr@.addr != 0,
Guarantee that the PointsTo
for any non-zero-sized type points to a non-null address.
sourcepub proof fn leak_contents(tracked &mut self)
pub proof fn leak_contents(tracked &mut self)
ensures
self.ptr() == old(self).ptr(),
self.is_uninit(),
“Forgets” about the value stored behind the pointer.
Updates the PointsTo
value to MemContents::Uninit
.
Note that this is a proof
function, i.e.,
it is operationally a no-op in executable code, even on the Rust Abstract Machine.
Only the proof-code representation changes.
sourcepub proof fn is_disjoint<S>(&mut self, other: &PointsTo<S>)
pub proof fn is_disjoint<S>(&mut self, other: &PointsTo<S>)
ensures
*old(self) == *self,
self.ptr() as int + size_of::<T>() <= other.ptr() as int
|| other.ptr() as int + size_of::<S>() <= self.ptr() as int,
Note: If both S and T are non-zero-sized, then this implies the pointers have distinct addresses.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for PointsTo<T>where
T: RefUnwindSafe,
impl<T> Send for PointsTo<T>where
T: Send,
impl<T> Sync for PointsTo<T>where
T: Sync,
impl<T> Unpin for PointsTo<T>where
T: Unpin,
impl<T> UnwindSafe for PointsTo<T>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