pub struct ReprPtr<R, T: Repr<R>> {
pub ptr: PPtr<R>,
pub _T: PhantomData<T>,
}Expand description
Concrete representation of a pointer to an object of type T with representation type R The length of the array is not stored in the pointer
Fields§
§ptr: PPtr<R>§_T: PhantomData<T>Implementations§
Source§impl<R, T: Repr<R>> ReprPtr<R, T>
impl<R, T: Repr<R>> ReprPtr<R, T>
Sourcepub exec fn new_borrowed<'a>(ptr: &'a PPtr<R>) -> res : &'a Self
pub exec fn new_borrowed<'a>(ptr: &'a PPtr<R>) -> res : &'a Self
ensures
*res == Self::new_spec(*ptr),Sourcepub exec fn from_pptr(ptr: PPtr<R>) -> res : Self
pub exec fn from_pptr(ptr: PPtr<R>) -> res : Self
ensures
res == Self::new_spec(ptr),res.addr() == ptr.addr(),res.ptr == ptr,Sourcepub exec fn take(self, Tracked(perm): Tracked<&mut PointsTo<R, T>>) -> v : T
pub exec fn take(self, Tracked(perm): Tracked<&mut PointsTo<R, T>>) -> v : T
requires
old(perm).pptr() == self,old(perm).is_init(),old(perm).wf(&old(perm).inner_perms),ensuresfinal(perm).pptr() == old(perm).pptr(),final(perm).mem_contents() == MemContents::Uninit::<T>,v == old(perm).value(),Sourcepub exec fn put(self, Tracked(perm): Tracked<&mut PointsTo<R, T>>, v: T)
pub exec fn put(self, Tracked(perm): Tracked<&mut PointsTo<R, T>>, v: T)
requires
old(perm).pptr() == self,old(perm).mem_contents() == MemContents::Uninit::<T>,ensuresfinal(perm).pptr() == old(perm).pptr(),final(perm).mem_contents() == MemContents::Init(v),final(perm).wf(&final(perm).inner_perms),Sourcepub exec fn borrow<'a>(self, Tracked(perm): Tracked<&'a PointsTo<R, T>>) -> v : &'a T
pub exec fn borrow<'a>(self, Tracked(perm): Tracked<&'a PointsTo<R, T>>) -> v : &'a T
requires
perm.pptr() == self,perm.is_init(),perm.wf(&perm.inner_perms),ensures*v === perm.value(),Sourcepub exec fn borrow_mut<'a>(
self,
verus_tmp_perm: Tracked<&'a mut PointsTo<R, T>>,
) -> v : &'a mut T
pub exec fn borrow_mut<'a>( self, verus_tmp_perm: Tracked<&'a mut PointsTo<R, T>>, ) -> v : &'a mut T
requires
old(perm).pptr() == self,old(perm).is_init(),old(perm).wf(&old(perm).inner_perms),ensures*v == old(perm).value(),final(perm).pptr() == old(perm).pptr(),final(perm).is_init(),final(perm).wf(&final(perm).inner_perms),Borrows the pointed-to T mutably for the lifetime of perm.
While the returned borrow is live, perm is exclusively held and
cannot be used. Mutations made through *v are not tracked by the
Verus model: the postcondition only promises the final perm is still
initialised and well-formed. Callers must preserve any invariants
beyond that themselves.
Trait Implementations§
impl<R, T: Repr<R>> Copy for ReprPtr<R, T>
Auto Trait Implementations§
impl<R, T> Freeze for ReprPtr<R, T>
impl<R, T> RefUnwindSafe for ReprPtr<R, T>where
T: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, T> Send for ReprPtr<R, T>
impl<R, T> Sync for ReprPtr<R, T>
impl<R, T> Unpin for ReprPtr<R, T>
impl<R, T> UnsafeUnpin for ReprPtr<R, T>
impl<R, T> UnwindSafe for ReprPtr<R, T>where
T: UnwindSafe,
R: 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