pub struct BTreeMapStorage<T>(/* private fields */);Expand description
A helper type for defining Computations with BTreeMap-backed storage
Implementations§
Source§impl<T> BTreeMapStorage<T>
impl<T> BTreeMapStorage<T>
Trait Implementations§
Source§impl<T: Clone> Clone for BTreeMapStorage<T>
impl<T: Clone> Clone for BTreeMapStorage<T>
Source§fn clone(&self) -> BTreeMapStorage<T>
fn clone(&self) -> BTreeMapStorage<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Computation for BTreeMapStorage<T>where
T: Computation + Ord,
impl<T> Computation for BTreeMapStorage<T>where
T: Computation + Ord,
type Output = <T as Computation>::Output
type Storage = (BTreeMap<BTreeMapStorage<T>, Cell>, BTreeMap<Cell, (BTreeMapStorage<T>, Option<<BTreeMapStorage<T> as Computation>::Output>)>)
fn run(&self, handle: &mut DbHandle<'_, impl Computation>) -> Self::Output
fn input_to_cell( input: &Self, (self_to_cell, _): &Self::Storage, ) -> Option<Cell>
fn get_function_and_output( cell: Cell, (_, cell_to_output): &Self::Storage, ) -> (&Self, Option<&Self::Output>)
fn set_output( cell: Cell, new_output: Self::Output, (_, cell_to_output): &mut Self::Storage, )
fn insert_new_cell(cell: Cell, function: Self, storage: &mut Self::Storage)
fn computation_id_of<T: Computation>() -> u32
fn get_storage<Concrete: Computation + 'static>( computation_id: u32, container: &Self::Storage, ) -> &Concrete::Storage
fn get_storage_mut<Concrete: Computation + 'static>( computation_id: u32, container: &mut Self::Storage, ) -> &mut Concrete::Storage
Source§fn output_is_unset<FullComputation: Computation>(
cell: Cell,
computation_id: u32,
original_computation_id: u32,
db: &Db<FullComputation>,
) -> bool
fn output_is_unset<FullComputation: Computation>( cell: Cell, computation_id: u32, original_computation_id: u32, db: &Db<FullComputation>, ) -> bool
True if this has any cached output
Source§fn dispatch_run<FullComputation: Computation>(
cell: Cell,
computation_id: u32,
original_computation_id: u32,
db: &mut Db<FullComputation>,
) -> bool
fn dispatch_run<FullComputation: Computation>( cell: Cell, computation_id: u32, original_computation_id: u32, db: &mut Db<FullComputation>, ) -> bool
Given a Cell, TypeId pair dispatch to the correct run function
and return true if the value has changed. This should also cache
the new value if it has changed.
Note that in dispatch functions
Self is always the concrete, non-tuple type.Source§fn dispatch_update_output<Concrete, FullComputation>(
cell: Cell,
computation_id: u32,
original_computation_id: u32,
output: Concrete::Output,
db: &mut Db<FullComputation>,
) -> bool
fn dispatch_update_output<Concrete, FullComputation>( cell: Cell, computation_id: u32, original_computation_id: u32, output: Concrete::Output, db: &mut Db<FullComputation>, ) -> bool
Dispatch to the correct update_output function to cache the new output
and return true if the value has changed.
Note that in dispatch functions
Self is the current type being dispatched,
Concrete, if present, is the non-tuple type of the target computation,
and FullComputation is the type of the Db computation parameter which is
usually a tuple of every possible computation.fn dispatch_input_to_cell<Concrete>(
input: &Concrete,
container: &Self::Storage,
) -> Option<Cell>where
Concrete: 'static + Computation + Any,
fn dispatch_insert_new_cell<Concrete>( cell: Cell, input: Concrete, storage: &mut Self::Storage, )
Source§impl<T: Debug> Debug for BTreeMapStorage<T>
impl<T: Debug> Debug for BTreeMapStorage<T>
Source§impl<T: Default> Default for BTreeMapStorage<T>
impl<T: Default> Default for BTreeMapStorage<T>
Source§fn default() -> BTreeMapStorage<T>
fn default() -> BTreeMapStorage<T>
Returns the “default value” for a type. Read more
Source§impl<T: Hash> Hash for BTreeMapStorage<T>
impl<T: Hash> Hash for BTreeMapStorage<T>
Source§impl<T: Ord> Ord for BTreeMapStorage<T>
impl<T: Ord> Ord for BTreeMapStorage<T>
Source§fn cmp(&self, other: &BTreeMapStorage<T>) -> Ordering
fn cmp(&self, other: &BTreeMapStorage<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for BTreeMapStorage<T>
impl<T: PartialEq> PartialEq for BTreeMapStorage<T>
Source§impl<T: PartialOrd> PartialOrd for BTreeMapStorage<T>
impl<T: PartialOrd> PartialOrd for BTreeMapStorage<T>
impl<T: Copy> Copy for BTreeMapStorage<T>
impl<T: Eq> Eq for BTreeMapStorage<T>
impl<T> StructuralPartialEq for BTreeMapStorage<T>
Auto Trait Implementations§
impl<T> Freeze for BTreeMapStorage<T>where
T: Freeze,
impl<T> RefUnwindSafe for BTreeMapStorage<T>where
T: RefUnwindSafe,
impl<T> Send for BTreeMapStorage<T>where
T: Send,
impl<T> Sync for BTreeMapStorage<T>where
T: Sync,
impl<T> Unpin for BTreeMapStorage<T>where
T: Unpin,
impl<T> UnwindSafe for BTreeMapStorage<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.