pub struct UniqueFrameOwner<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> {
pub meta_own: M::Owner,
pub meta_perm: PointsTo<MetaSlot, Metadata<M>>,
pub slot_index: usize,
}Fields§
§meta_own: M::Owner§meta_perm: PointsTo<MetaSlot, Metadata<M>>§slot_index: usizeImplementations§
Source§impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> UniqueFrameOwner<Link<M>>
impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> UniqueFrameOwner<Link<M>>
Sourcepub open spec fn frame_link_inv(&self) -> bool
pub open spec fn frame_link_inv(&self) -> bool
{
&&& self.meta_perm.value().metadata.prev is None
&&& self.meta_perm.value().metadata.next is None
&&& self.meta_own.paddr == self.meta_perm.addr()
}Source§impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> UniqueFrameOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> UniqueFrameOwner<M>
Sourcepub open spec fn perm_inv(self, perm: PointsTo<MetaSlot>) -> bool
pub open spec fn perm_inv(self, perm: PointsTo<MetaSlot>) -> bool
{
&&& perm.is_init()
&&& perm.addr() == self.meta_perm.addr()
}Sourcepub open spec fn global_inv(self, regions: MetaRegionOwners) -> bool
pub open spec fn global_inv(self, regions: MetaRegionOwners) -> bool
{
&&& !regions.slots.contains_key(self.slot_index)
&&& regions.slot_owners.contains_key(self.slot_index)
&&& regions.slot_owners[self.slot_index].inner_perms == self.meta_perm.inner_perms
&&& self.meta_perm.addr() == regions.slot_owners[self.slot_index].self_addr
}Sourcepub proof fn from_raw_owner(
owner: M::Owner,
index: Ghost<usize>,
perm: PointsTo<MetaSlot, Metadata<M>>,
) -> Self
pub proof fn from_raw_owner( owner: M::Owner, index: Ghost<usize>, perm: PointsTo<MetaSlot, Metadata<M>>, ) -> Self
Sourcepub open spec fn from_unused_owner_spec(
old_regions: MetaRegionOwners,
paddr: Paddr,
metadata: M,
res: Self,
regions: MetaRegionOwners,
) -> bool
pub open spec fn from_unused_owner_spec( old_regions: MetaRegionOwners, paddr: Paddr, metadata: M, res: Self, regions: MetaRegionOwners, ) -> bool
{
&&& <M as OwnerOf>::wf(metadata, res.meta_own)
&&& res.meta_perm.addr() == frame_to_meta(paddr)
&&& regions.slots == old_regions.slots.remove(frame_to_index(paddr))
&&& regions.slot_owners[frame_to_index(paddr)].raw_count
== old_regions.slot_owners[frame_to_index(paddr)].raw_count
&&& regions.slot_owners[frame_to_index(paddr)].usage
== old_regions.slot_owners[frame_to_index(paddr)].usage
&&& regions.slot_owners[frame_to_index(paddr)].path_if_in_pt
== old_regions.slot_owners[frame_to_index(paddr)].path_if_in_pt
&&& forall |i: usize| {
i != frame_to_index(paddr)
==> regions.slot_owners[i] == old_regions.slot_owners[i]
}
&&& regions.inv()
}Sourcepub proof fn from_unused_owner(tracked
regions: &mut MetaRegionOwners,
paddr: Paddr,
meta_perm: PointsTo<MetaSlot, Metadata<M>>,
) -> tracked res : Self
pub proof fn from_unused_owner(tracked regions: &mut MetaRegionOwners, paddr: Paddr, meta_perm: PointsTo<MetaSlot, Metadata<M>>, ) -> tracked res : Self
ensures
Self::from_unused_owner_spec(
*old(regions),
paddr,
meta_perm.value().metadata,
res,
*regions,
),Trait Implementations§
Source§impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> Inv for UniqueFrameOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> Inv for UniqueFrameOwner<M>
Source§open spec fn inv(self) -> bool
open spec fn inv(self) -> bool
{
&&& self.meta_perm.is_init()
&&& self.meta_perm.wf(&self.meta_perm.inner_perms)
&&& self.slot_index == frame_to_index(meta_to_frame(self.meta_perm.addr()))
&&& self.slot_index < max_meta_slots()
&&& (self.slot_index - FRAME_METADATA_RANGE.start) as usize % META_SLOT_SIZE == 0
&&& self.meta_perm.addr()
< FRAME_METADATA_RANGE.start + MAX_NR_PAGES * META_SLOT_SIZE
&&& self.meta_perm.addr() == meta_addr(self.slot_index)
&&& self.meta_perm.addr() == self.meta_perm.points_to.addr()
&&& self.meta_perm.value().metadata.wf(self.meta_own)
}Source§impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> InvView for UniqueFrameOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> InvView for UniqueFrameOwner<M>
Source§proof fn view_preserves_inv(self)
proof fn view_preserves_inv(self)
Source§impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> View for UniqueFrameOwner<M>
impl<M: AnyFrameMeta + Repr<MetaSlotStorage> + OwnerOf> View for UniqueFrameOwner<M>
Auto Trait Implementations§
impl<M> Freeze for UniqueFrameOwner<M>where
<M as OwnerOf>::Owner: Freeze,
impl<M> !RefUnwindSafe for UniqueFrameOwner<M>
impl<M> Send for UniqueFrameOwner<M>
impl<M> Sync for UniqueFrameOwner<M>
impl<M> Unpin for UniqueFrameOwner<M>
impl<M> UnwindSafe for UniqueFrameOwner<M>where
<M as OwnerOf>::Owner: UnwindSafe,
M: 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