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>;
type SCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>;
Show 20 methods
// Required methods
fn open<S: Clone + Into<StorageMode>>(storage: S) -> 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;
fn scm_map(&self) -> &Self::SCMMap;
// Provided methods
fn storage_mode(&self) -> &StorageMode { ... }
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 TPKMap: for<'a> Map<'a, N::TransitionID, Group<N>>
type TPKMap: for<'a> Map<'a, N::TransitionID, Group<N>>
The transition public keys.
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 TCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>
type TCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>
The transition commitments.
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
.
Sourcetype SCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>
type SCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>
The signer commitments.
Required Methods§
Sourcefn open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>
fn open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>
Initializes the transition storage.
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 storage_mode(&self) -> &StorageMode
fn storage_mode(&self) -> &StorageMode
Returns the storage mode.
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
.
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.