PermCellOwn

Struct PermCellOwn 

Source
pub struct PermCellOwn<T: ?Sized>(/* private fields */);
Expand description

Token that represents the ownership of a PermCell object.

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

Implementations§

Source§

impl<T: ?Sized> PermCellOwn<T>

Source

pub fn id(self) -> Id

Returns the logical identity of the cell.

To use a PermCell, this and PermCell::id must agree.

(opaque)

Source

pub fn val<'a>(self) -> &'a T

Get the logical value.

(opaque)

Source

pub fn id_ghost(&self) -> Ghost<Id>

terminates

ghost

ensures

*result == self.id()

Source

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

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

terminates

ghost

ensures

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

ensures

*own1 == ^own1

Trait Implementations§

Source§

impl<T: Sized> Invariant for PermCellOwn<T>

Source§

fn invariant(self) -> bool

(open, prophetic, inline)

pearlite! { inv(self.val()) }

Source§

impl<T: ?Sized> Resolve for PermCellOwn<T>

Source§

fn resolve(self) -> bool

(open, prophetic, inline)

resolve(self.val())

Source§

fn resolve_coherence(self)

(prophetic)

requires

inv(self)

requires

structural_resolve(self)

ensures

self.resolve()

Source§

impl<T> View for PermCellOwn<T>

Source§

fn view(self) -> Self::ViewTy

(open, inline)

*self.val()

Source§

type ViewTy = T

Auto Trait Implementations§

§

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

§

impl<T> RefUnwindSafe for PermCellOwn<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for PermCellOwn<T>
where T: Send + ?Sized,

§

impl<T> Sync for PermCellOwn<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for PermCellOwn<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for PermCellOwn<T>
where T: UnwindSafe + ?Sized,

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