Struct PCellOwn

Source
pub struct PCellOwn<T: ?Sized> {
    pub id: Id,
    pub val: Box<T>,
    /* private fields */
}
Expand description

Token that represents the ownership of a PCell object.

A PCellOwn only exists in the ghost world, and it must be used in conjunction with PCell in order to read or write the value.

Fields§

§id: Id§val: Box<T>

Implementations§

Source§

impl<T> PCellOwn<T>
where T: ?Sized,

Source

pub fn id(self) -> Id

Returns the logical identity of the cell.

To use a [Pcell], this and PCell::id must agree.

logic

self.id

Source

pub fn val(self) -> SizedW<T>

Get the logical value.

logic

self.val

Source

pub fn disjoint_lemma(own1: &mut PCellOwn<T>, own2: &PCellOwn<T>)

If one owns two PCellOwns in ghost code, then they have different ids.

pure

ensures

own1.id() != own2.id()

ensures

*own1 == ^own1

Trait Implementations§

Source§

impl<T> View for PCellOwn<T>

Source§

fn view(self) -> Self::ViewTy

logic

*self.val

Source§

type ViewTy = T

Auto Trait Implementations§

§

impl<T> Freeze for PCellOwn<T>
where T: ?Sized,

§

impl<T> !RefUnwindSafe for PCellOwn<T>

§

impl<T> !Send for PCellOwn<T>

§

impl<T> !Sync for PCellOwn<T>

§

impl<T> Unpin for PCellOwn<T>
where T: ?Sized,

§

impl<T> !UnwindSafe for PCellOwn<T>

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.

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.

Source§

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

Source§

fn make_sized(&self) -> Box<T>

logic

ensures

*result == *self

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.
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.