pub struct Db<C: Computation> { /* private fields */ }Implementations§
Source§impl<C: Computation> Db<C>
impl<C: Computation> Db<C>
Sourcepub fn is_stale<Concrete: Computation>(&self, input: &Concrete) -> bool
pub fn is_stale<Concrete: Computation>(&self, input: &Concrete) -> bool
True if a given input is stale and needs to be re-computed. Inputs which have never been computed are also considered stale.
This does not actually re-compute the input.
Sourcepub fn is_stale_cell(&self, cell: Cell) -> bool
pub fn is_stale_cell(&self, cell: Cell) -> bool
True if a given cell is stale and needs to be re-computed. This does not actually re-compute the input.
Sourcepub fn get_cell<ConcreteC: Computation>(
&self,
input: &ConcreteC,
) -> Option<Cell>
pub fn get_cell<ConcreteC: Computation>( &self, input: &ConcreteC, ) -> Option<Cell>
Return the corresponding Cell for a given input, if it exists.
This will not update any values.
pub fn get_or_insert_cell<ConcreteC>(&mut self, input: ConcreteC) -> Cellwhere
ConcreteC: Computation,
Sourcepub fn update_input<ConcreteC>(
&mut self,
input: ConcreteC,
new_value: ConcreteC::Output,
)
pub fn update_input<ConcreteC>( &mut self, input: ConcreteC, new_value: ConcreteC::Output, )
Updates an input with a new value
May panic in Debug mode if the input is not an input - ie. it has at least 1 dependency. Note that this step is skipped when compiling in Release mode.
pub fn storage(&self) -> &C::Storage
pub fn storage_mut(&mut self) -> &mut C::Storage
Source§impl<C: Computation + Clone> Db<C>
impl<C: Computation + Clone> Db<C>
Sourcepub fn get<Concrete: Computation>(
&mut self,
compute: Concrete,
) -> &Concrete::Output
pub fn get<Concrete: Computation>( &mut self, compute: Concrete, ) -> &Concrete::Output
Retrieves the up to date value for the given computation, re-running any dependencies as necessary.
This function can panic if the dynamic type of the value returned by compute.run(..) is not T.
Sourcepub fn get_with_cell<Concrete: Computation>(
&mut self,
cell_id: Cell,
) -> &Concrete::Output
pub fn get_with_cell<Concrete: Computation>( &mut self, cell_id: Cell, ) -> &Concrete::Output
Retrieves the up to date value for the given cell, re-running any dependencies as necessary.
This function can panic if the dynamic type of the value returned by compute.run(..) is not T.