Metadata

Struct Metadata 

Source
pub struct Metadata<M: AnyFrameMeta> {
    pub metadata: M,
    pub ref_count: u64,
    pub vtable_ptr: MemContents<usize>,
    pub in_list: u64,
}

Fields§

§metadata: M§ref_count: u64§vtable_ptr: MemContents<usize>§in_list: u64

Implementations§

Source§

impl<M: AnyFrameMeta + Repr<MetaSlotStorage>> Metadata<M>

Source

pub uninterp fn metadata_from_inner_perms(perm: PointsTo<MetaSlotStorage>) -> M

The metadata value is an abstract function of the inner permissions, since extracting M from MetaSlotStorage requires M::Perm which is not stored in MetadataInnerPerms.

Trait Implementations§

Source§

impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> From<Metadata<Link<M>>> for MetadataAsLink<M>

Source§

exec fn from(m: Metadata<Link<M>>) -> Self

Source§

impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> From<MetadataAsLink<M>> for Metadata<Link<M>>

Source§

exec fn from(m: MetadataAsLink<M>) -> Self

Source§

impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> FromSpecImpl<Metadata<Link<M>>> for MetadataAsLink<M>

Source§

open spec fn obeys_from_spec() -> bool

{ true }
Source§

open spec fn from_spec(m: Metadata<Link<M>>) -> MetadataAsLink<M>

{
    MetadataAsLink {
        metadata: m.metadata.meta,
        next: match m.metadata.next {
            Some(repr_ptr) => Some(repr_ptr.ptr),
            None => None,
        },
        prev: match m.metadata.prev {
            Some(repr_ptr) => Some(repr_ptr.ptr),
            None => None,
        },
        ref_count: m.ref_count,
        vtable_ptr: m.vtable_ptr,
        in_list: m.in_list,
    }
}
Source§

impl<M: AnyFrameMeta + Repr<MetaSlotSmall>> FromSpecImpl<MetadataAsLink<M>> for Metadata<Link<M>>

Source§

open spec fn obeys_from_spec() -> bool

{ true }
Source§

open spec fn from_spec(m: MetadataAsLink<M>) -> Metadata<Link<M>>

{
    Metadata {
        metadata: Link {
            next: match m.next {
                Some(pptr) => {
                    Some(ReprPtr {
                        addr: pptr.addr(),
                        ptr: pptr,
                        _T: PhantomData,
                    })
                }
                None => None,
            },
            prev: match m.prev {
                Some(pptr) => {
                    Some(ReprPtr {
                        addr: pptr.addr(),
                        ptr: pptr,
                        _T: PhantomData,
                    })
                }
                None => None,
            },
            meta: m.metadata,
        },
        ref_count: m.ref_count,
        vtable_ptr: m.vtable_ptr,
        in_list: m.in_list,
    }
}
Source§

impl<M: AnyFrameMeta + Repr<MetaSlotStorage>> Repr<MetaSlot> for Metadata<M>

Source§

open spec fn wf(r: MetaSlot, perm: MetadataInnerPerms) -> bool

{
    &&& perm.storage.id() == r.storage.id()
    &&& perm.ref_count.id() == r.ref_count.id()
    &&& perm.vtable_ptr.pptr() == r.vtable_ptr
    &&& perm.in_list.id() == r.in_list.id()

}
Source§

uninterp fn to_repr_spec( self, perm: MetadataInnerPerms, ) -> (MetaSlot, MetadataInnerPerms)

Source§

exec fn to_repr(self, Tracked(perm): Tracked<&mut MetadataInnerPerms>) -> MetaSlot

Source§

open spec fn from_repr_spec(r: MetaSlot, perm: MetadataInnerPerms) -> Self

{
    Metadata {
        metadata: Self::metadata_from_inner_perms(perm.storage),
        ref_count: perm.ref_count.value(),
        vtable_ptr: perm.vtable_ptr.mem_contents(),
        in_list: perm.in_list.value(),
    }
}
Source§

exec fn from_repr(r: MetaSlot, Tracked(perm): Tracked<&MetadataInnerPerms>) -> Self

Source§

exec fn from_borrowed<'a>( r: &'a MetaSlot, verus_tmp_perm: Tracked<&'a MetadataInnerPerms>, ) -> &'a Self

Source§

proof fn from_to_repr(self, perm: MetadataInnerPerms)

Source§

proof fn to_from_repr(r: MetaSlot, perm: MetadataInnerPerms)

Source§

proof fn to_repr_wf(self, perm: MetadataInnerPerms)

Source§

type Perm = MetadataInnerPerms

If the underlying representation contains cells, the translation may require permission objects that access them.

Auto Trait Implementations§

§

impl<M> Freeze for Metadata<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for Metadata<M>
where M: RefUnwindSafe,

§

impl<M> Send for Metadata<M>
where M: Send,

§

impl<M> Sync for Metadata<M>
where M: Sync,

§

impl<M> Unpin for Metadata<M>
where M: Unpin,

§

impl<M> UnwindSafe for Metadata<M>
where M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

§

fn obeys_from_spec() -> bool

§

fn from_spec(v: T) -> VERUS_SPEC__A

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> T

§

impl<T, U> IntoSpecImpl<U> for T
where U: From<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

§

fn obeys_try_from_spec() -> bool

§

fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

§

impl<T, U> TryIntoSpecImpl<U> for T
where U: TryFrom<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<U, <U as TryFrom<T>>::Error>