pub struct CursorOwner<M: AnyFrameMeta + Repr<MetaSlotSmall>> {
pub list_own: LinkedListOwner<M>,
pub index: int,
}Fields§
§list_own: LinkedListOwner<M>§index: intImplementations§
Source§impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> CursorOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> CursorOwner<M>
Sourcepub open spec fn wf_with_region(self, regions: MetaRegionOwners) -> bool
pub open spec fn wf_with_region(self, regions: MetaRegionOwners) -> bool
{
&&& 0 <= self.index <= self.length()
&&& self.list_own.relate_region(regions)
}Region-based analog of CursorOwner::inv: replaces list_own.inv()
(over the owned perms) with list_own.relate_region(regions) (over
the region permissions).
Sourcepub open spec fn current(self) -> Option<LinkOwner>
pub open spec fn current(self) -> Option<LinkOwner>
{
if 0 <= self.index < self.length() {
Some(self.list_own.list[self.index])
} else {
None
}
}Sourcepub open spec fn list_insert(
cursor: Self,
link: LinkOwner,
repr_perm: LinkInnerPerms<M>,
metadata_perms: MetadataPerm,
list_id: u64,
) -> (Self, LinkOwner)
pub open spec fn list_insert( cursor: Self, link: LinkOwner, repr_perm: LinkInnerPerms<M>, metadata_perms: MetadataPerm, list_id: u64, ) -> (Self, LinkOwner)
{
let link = LinkOwner {
paddr: link.paddr,
in_list: list_id,
};
(
Self {
list_own: LinkedListOwner::<M> {
list: cursor.list_own.list.insert(cursor.index, link),
repr_perms: cursor.list_own.repr_perms.insert(cursor.index, repr_perm),
metadata_perms: cursor
.list_own
.metadata_perms
.insert(cursor.index, metadata_perms),
list_id,
_marker: PhantomData,
},
index: cursor.index + 1,
},
link,
)
}Sourcepub proof fn tracked_list_insert(
tracked cursor: &mut Self,
tracked link: &mut LinkOwner,
tracked repr_perm: LinkInnerPerms<M>,
tracked metadata_perms: MetadataPerm,
list_id: u64,
)
pub proof fn tracked_list_insert( tracked cursor: &mut Self, tracked link: &mut LinkOwner, tracked repr_perm: LinkInnerPerms<M>, tracked metadata_perms: MetadataPerm, list_id: u64, )
requires
list_id != 0,0 <= old(cursor).index <= old(cursor).list_own.list.len(),old(cursor).list_own.repr_perms.len() == old(cursor).list_own.list.len(),old(cursor).list_own.metadata_perms.len() == old(cursor).list_own.list.len(),old(cursor).list_own.list.len() > 0 ==> list_id == old(cursor).list_own.list_id,old(cursor).list_own.list_id != 0 ==> list_id == old(cursor).list_own.list_id,ensures({
let res = Self::list_insert(
*old(cursor),
*old(link),
repr_perm,
metadata_perms,
list_id,
);
res.0 == *final(cursor) && res.1 == *final(link)
}),Tracked update to the cursor’s owner state when a new link is inserted
before the current position. The inserted link’s paddr is unchanged
and its in_list is stamped with list_id — the (non-zero) id the
concrete lazy_get_id resolved. The cursor’s list gains link at
old.index, adopts list_id (which equals the old id when that was
already non-zero), and index advances by one. In the borrow model, the
link’s tracked permission remains parked in MetaRegionOwners.slots;
this axiom doesn’t need to take or carry a perm.
Sourcepub open spec fn front_owner(list_own: LinkedListOwner<M>) -> Self
pub open spec fn front_owner(list_own: LinkedListOwner<M>) -> Self
{
CursorOwner::<M> {
list_own: list_own,
index: 0,
}
}Sourcepub open spec fn cursor_mut_at_owner(list_own: LinkedListOwner<M>, index: int) -> Self
pub open spec fn cursor_mut_at_owner(list_own: LinkedListOwner<M>, index: int) -> Self
{
CursorOwner::<M> {
list_own: list_own,
index: index,
}
}Sourcepub proof fn tracked_cursor_mut_at_owner(
tracked list_own: LinkedListOwner<M>,
index: int,
) -> tracked Self
pub proof fn tracked_cursor_mut_at_owner( tracked list_own: LinkedListOwner<M>, index: int, ) -> tracked Self
returns
Self::cursor_mut_at_owner(list_own, index),Sourcepub proof fn tracked_front_owner(tracked list_own: LinkedListOwner<M>) -> tracked Self
pub proof fn tracked_front_owner(tracked list_own: LinkedListOwner<M>) -> tracked Self
returns
Self::front_owner(list_own),Sourcepub open spec fn back_owner(list_own: LinkedListOwner<M>) -> Self
pub open spec fn back_owner(list_own: LinkedListOwner<M>) -> Self
{
CursorOwner::<M> {
list_own: list_own,
index: if list_own.list.len() > 0 { list_own.list.len() - 1 } else { 0 },
}
}Sourcepub proof fn tracked_back_owner(tracked list_own: LinkedListOwner<M>) -> tracked res : Self
pub proof fn tracked_back_owner(tracked list_own: LinkedListOwner<M>) -> tracked res : Self
ensures
res == Self::back_owner(list_own),Source§impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> CursorOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> CursorOwner<M>
Sourcepub open spec fn remove_owner_spec(self, post: Self) -> bool
pub open spec fn remove_owner_spec(self, post: Self) -> bool
{
&&& post.list_own.list == self.list_own.list.remove(self.index)
&&& post.index == self.index
}Sourcepub proof fn remove_owner_spec_implies_model_spec(self, post: Self)
pub proof fn remove_owner_spec_implies_model_spec(self, post: Self)
requires
self.remove_owner_spec(post),0 <= self.index < self.length(),ensurespost@ == self@.remove(),Sourcepub open spec fn insert_owner_spec(self, link: LinkOwner, post: Self) -> bool
pub open spec fn insert_owner_spec(self, link: LinkOwner, post: Self) -> bool
{
&&& post.list_own.list == self.list_own.list.insert(self.index, link)
&&& post.index == self.index + 1
}Sourcepub proof fn insert_owner_spec_implies_model_spec(self, link: LinkOwner, post: Self)
pub proof fn insert_owner_spec_implies_model_spec(self, link: LinkOwner, post: Self)
requires
self.insert_owner_spec(link, post),0 <= self.index <= self.length(),ensurespost@ == self@.insert(link@),Sourcepub open spec fn move_next_owner_spec(self) -> Self
pub open spec fn move_next_owner_spec(self) -> Self
{
if self.length() == 0 {
self
} else if self.index == self.length() {
Self {
list_own: self.list_own,
index: 0,
}
} else if self.index == self.length() - 1 {
Self {
list_own: self.list_own,
index: self.index + 1,
}
} else {
Self {
list_own: self.list_own,
index: self.index + 1,
}
}
}Sourcepub open spec fn move_prev_owner_spec(self) -> Self
pub open spec fn move_prev_owner_spec(self) -> Self
{
if self.length() == 0 {
self
} else if self.index == self.length() {
Self {
list_own: self.list_own,
index: self.index - 1,
}
} else if self.index == 0 {
Self {
list_own: self.list_own,
index: self.length(),
}
} else {
Self {
list_own: self.list_own,
index: self.index - 1,
}
}
}Trait Implementations§
Source§impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> Inv for CursorOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> Inv for CursorOwner<M>
Source§impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> InvView for CursorOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> InvView for CursorOwner<M>
Source§proof fn view_preserves_inv(self)
proof fn view_preserves_inv(self)
Source§impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> View for CursorOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> View for CursorOwner<M>
Auto Trait Implementations§
impl<M> !RefUnwindSafe for CursorOwner<M>
impl<M> Freeze for CursorOwner<M>
impl<M> Send for CursorOwner<M>
impl<M> Sync for CursorOwner<M>
impl<M> Unpin for CursorOwner<M>
impl<M> UnsafeUnpin for CursorOwner<M>
impl<M> UnwindSafe for CursorOwner<M>
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
fn obeys_from_spec() -> bool
fn from_spec(v: T) -> VERUS_SPEC__A
§impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> T
§impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> U
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.impl<A> SpecEq<&A> for Awhere
A: ?Sized,
impl<A> SpecEq<&mut A> for Awhere
A: ?Sized,
impl<A> SpecEq<A> for Awhere
A: ?Sized,
impl<A> SpecEq<Ghost<A>> for A
impl<A> SpecEq<Tracked<A>> for A
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.