pub trait TransitionStorage<N: Network>: Clone + Send + Sync {
type LocatorMap: for<'a> Map<'a, N::TransitionID, (ProgramID<N>, Identifier<N>)>;
type InputStorage: InputStorage<N>;
type OutputStorage: OutputStorage<N>;
type TPKMap: for<'a> Map<'a, N::TransitionID, Group<N>>;
type ReverseTPKMap: for<'a> Map<'a, Group<N>, N::TransitionID>;
type TCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>;
type ReverseTCMMap: for<'a> Map<'a, Field<N>, N::TransitionID>;
Show 19 methods
// Required methods
fn open(dev: Option<u16>) -> Result<Self>;
fn locator_map(&self) -> &Self::LocatorMap;
fn input_store(&self) -> &InputStore<N, Self::InputStorage>;
fn output_store(&self) -> &OutputStore<N, Self::OutputStorage>;
fn tpk_map(&self) -> &Self::TPKMap;
fn reverse_tpk_map(&self) -> &Self::ReverseTPKMap;
fn tcm_map(&self) -> &Self::TCMMap;
fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap;
// Provided methods
fn dev(&self) -> Option<u16> { ... }
fn start_atomic(&self) { ... }
fn is_atomic_in_progress(&self) -> bool { ... }
fn atomic_checkpoint(&self) { ... }
fn clear_latest_checkpoint(&self) { ... }
fn atomic_rewind(&self) { ... }
fn abort_atomic(&self) { ... }
fn finish_atomic(&self) -> Result<()> { ... }
fn insert(&self, transition: &Transition<N>) -> Result<()> { ... }
fn remove(&self, transition_id: &N::TransitionID) -> Result<()> { ... }
fn get(
&self,
transition_id: &N::TransitionID
) -> Result<Option<Transition<N>>> { ... }
}
Expand description
A trait for transition storage.
Required Associated Types§
sourcetype LocatorMap: for<'a> Map<'a, N::TransitionID, (ProgramID<N>, Identifier<N>)>
type LocatorMap: for<'a> Map<'a, N::TransitionID, (ProgramID<N>, Identifier<N>)>
The transition program IDs and function names.
sourcetype InputStorage: InputStorage<N>
type InputStorage: InputStorage<N>
The transition inputs.
sourcetype OutputStorage: OutputStorage<N>
type OutputStorage: OutputStorage<N>
The transition outputs.
sourcetype ReverseTPKMap: for<'a> Map<'a, Group<N>, N::TransitionID>
type ReverseTPKMap: for<'a> Map<'a, Group<N>, N::TransitionID>
The mapping of transition public key
to transition ID
.
sourcetype ReverseTCMMap: for<'a> Map<'a, Field<N>, N::TransitionID>
type ReverseTCMMap: for<'a> Map<'a, Field<N>, N::TransitionID>
The mapping of transition commitment
to transition ID
.
Required Methods§
sourcefn locator_map(&self) -> &Self::LocatorMap
fn locator_map(&self) -> &Self::LocatorMap
Returns the transition program IDs and function names.
sourcefn input_store(&self) -> &InputStore<N, Self::InputStorage>
fn input_store(&self) -> &InputStore<N, Self::InputStorage>
Returns the transition input store.
sourcefn output_store(&self) -> &OutputStore<N, Self::OutputStorage>
fn output_store(&self) -> &OutputStore<N, Self::OutputStorage>
Returns the transition output store.
sourcefn reverse_tpk_map(&self) -> &Self::ReverseTPKMap
fn reverse_tpk_map(&self) -> &Self::ReverseTPKMap
Returns the reverse tpk
map.
sourcefn reverse_tcm_map(&self) -> &Self::ReverseTCMMap
fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap
Returns the reverse tcm
map.
Provided Methods§
sourcefn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
sourcefn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
sourcefn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
sourcefn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
sourcefn atomic_rewind(&self)
fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
sourcefn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcefn finish_atomic(&self) -> Result<()>
fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
sourcefn insert(&self, transition: &Transition<N>) -> Result<()>
fn insert(&self, transition: &Transition<N>) -> Result<()>
Stores the given transition
into storage.
sourcefn remove(&self, transition_id: &N::TransitionID) -> Result<()>
fn remove(&self, transition_id: &N::TransitionID) -> Result<()>
Removes the input for the given transition ID
.
sourcefn get(&self, transition_id: &N::TransitionID) -> Result<Option<Transition<N>>>
fn get(&self, transition_id: &N::TransitionID) -> Result<Option<Transition<N>>>
Returns the transition for the given transition ID
.