Skip to main content

StorageResource

Struct StorageResource 

Source
pub struct StorageResource<K, V, P> { /* private fields */ }
Expand description

Interface for “storage protocol” ghost state. This is an extension-slash-variant on the more well-known concept of “PCM” ghost state, which we also have an interface for here. The unique feature of a storage protocol is the ability to use guard to manipulate shared references of ghost state.

Storage protocols are based on Leaf: Modularity for Temporary Sharing in Separation Logic.

The reference for the laws and operations we’re embedding here can be found at: https://github.com/secure-foundations/leaf/blob/9d72b880feb6af0a7e752b2b2a43806a0812ad56/src/guarding/protocol_relational.v

The reference version requires two monoids, the “protocol monoid” and the “base monoid”. In this interface, we fix the base monoid to be of the form IMap<K, V>. (with composition of overlapping maps being undefined), which has all the necessary properties. Note that there’s no create_unit (it’s not sound to do this for an arbitrary location unless you already know a protocol was initialized at that location).

For applications, I generally advise using the tokenized_state_machine! system, rather than using this interface directly.

Auto Trait Implementations§

§

impl<K, V, P> Freeze for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: Freeze, SyncSendIfSyncSend<IMap<K, V>>: Freeze,

§

impl<K, V, P> RefUnwindSafe for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: RefUnwindSafe, SyncSendIfSyncSend<IMap<K, V>>: RefUnwindSafe,

§

impl<K, V, P> Send for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: Send, SyncSendIfSyncSend<IMap<K, V>>: Send,

§

impl<K, V, P> Sync for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: Sync, SyncSendIfSyncSend<IMap<K, V>>: Sync,

§

impl<K, V, P> Unpin for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: Unpin, SyncSendIfSyncSend<IMap<K, V>>: Unpin,

§

impl<K, V, P> UnsafeUnpin for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: UnsafeUnpin, SyncSendIfSyncSend<IMap<K, V>>: UnsafeUnpin,

§

impl<K, V, P> UnwindSafe for StorageResource<K, V, P>
where PhantomData<(K, V, P)>: UnwindSafe, SyncSendIfSyncSend<IMap<K, V>>: 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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.