pub struct SingletonStorage<K: OutputType> { /* private fields */ }Expand description
Helper to store a simple computation type which has no fields and thus does not require a map to cache each possible value.
Examples include struct SourceFile; or struct Time;
Trait Implementations§
Source§impl<K: OutputType> Default for SingletonStorage<K>
impl<K: OutputType> Default for SingletonStorage<K>
Source§impl<'de, K> Deserialize<'de> for SingletonStorage<K>
impl<'de, K> Deserialize<'de> for SingletonStorage<K>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K> Serialize for SingletonStorage<K>
impl<K> Serialize for SingletonStorage<K>
Source§impl<K> StorageFor<K> for SingletonStorage<K>
impl<K> StorageFor<K> for SingletonStorage<K>
Source§fn get_cell_for_computation(&self, _: &K) -> Option<Cell>
fn get_cell_for_computation(&self, _: &K) -> Option<Cell>
Given a computation key, return the cell associated with it, if it exists.
Source§fn insert_new_cell(&self, cell: Cell, key: K)
fn insert_new_cell(&self, cell: Cell, key: K)
Insert a new Cell with the given computation that has yet to be run
Source§fn get_input(&self, _: Cell) -> K
fn get_input(&self, _: Cell) -> K
Retrieve the input for this computation.
The input is expected to already be inserted into this storage.
Auto Trait Implementations§
impl<K> !Freeze for SingletonStorage<K>
impl<K> RefUnwindSafe for SingletonStorage<K>where
K: RefUnwindSafe + UnwindSafe,
impl<K> Send for SingletonStorage<K>
impl<K> Sync for SingletonStorage<K>
impl<K> Unpin for SingletonStorage<K>
impl<K> UnwindSafe for SingletonStorage<K>where
K: 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