pub trait TransitionStorage<N>:
Clone
+ Send
+ Syncwhere
N: Network,{
type LocatorMap: for<'a> Map<'a, <N as Network>::TransitionID, (ProgramID<N>, Identifier<N>)>;
type InputStorage: InputStorage<N>;
type OutputStorage: OutputStorage<N>;
type TPKMap: for<'a> Map<'a, <N as Network>::TransitionID, Group<N>>;
type ReverseTPKMap: for<'a> Map<'a, Group<N>, <N as Network>::TransitionID>;
type TCMMap: for<'a> Map<'a, <N as Network>::TransitionID, Field<N>>;
type ReverseTCMMap: for<'a> Map<'a, Field<N>, <N as Network>::TransitionID>;
Show 19 methods
// Required methods
fn open(dev: Option<u16>) -> Result<Self, Error>;
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<(), Error> { ... }
fn insert(&self, transition: &Transition<N>) -> Result<(), Error> { ... }
fn remove(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<(), Error> { ... }
fn get(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<Transition<N>>, Error> { ... }
}Expand description
A trait for transition storage.
Required Associated Types§
Sourcetype LocatorMap: for<'a> Map<'a, <N as Network>::TransitionID, (ProgramID<N>, Identifier<N>)>
type LocatorMap: for<'a> Map<'a, <N as Network>::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 TPKMap: for<'a> Map<'a, <N as Network>::TransitionID, Group<N>>
type TPKMap: for<'a> Map<'a, <N as Network>::TransitionID, Group<N>>
The transition public keys.
Sourcetype ReverseTPKMap: for<'a> Map<'a, Group<N>, <N as Network>::TransitionID>
type ReverseTPKMap: for<'a> Map<'a, Group<N>, <N as Network>::TransitionID>
The mapping of transition public key to transition ID.
Sourcetype TCMMap: for<'a> Map<'a, <N as Network>::TransitionID, Field<N>>
type TCMMap: for<'a> Map<'a, <N as Network>::TransitionID, Field<N>>
The transition commitments.
Sourcetype ReverseTCMMap: for<'a> Map<'a, Field<N>, <N as Network>::TransitionID>
type ReverseTCMMap: for<'a> Map<'a, Field<N>, <N as Network>::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<(), Error>
fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
Sourcefn insert(&self, transition: &Transition<N>) -> Result<(), Error>
fn insert(&self, transition: &Transition<N>) -> Result<(), Error>
Stores the given transition into storage.
Sourcefn remove(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<(), Error>
fn remove( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<(), Error>
Removes the input for the given transition ID.
Sourcefn get(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<Transition<N>>, Error>
fn get( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<Option<Transition<N>>, Error>
Returns the transition for the given transition ID.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.