snarkvm_ledger_store

Trait TransitionStorage

Source
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§

Source

type LocatorMap: for<'a> Map<'a, N::TransitionID, (ProgramID<N>, Identifier<N>)>

The transition program IDs and function names.

Source

type InputStorage: InputStorage<N>

The transition inputs.

Source

type OutputStorage: OutputStorage<N>

The transition outputs.

Source

type TPKMap: for<'a> Map<'a, N::TransitionID, Group<N>>

The transition public keys.

Source

type ReverseTPKMap: for<'a> Map<'a, Group<N>, N::TransitionID>

The mapping of transition public key to transition ID.

Source

type TCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>

The transition commitments.

Source

type ReverseTCMMap: for<'a> Map<'a, Field<N>, N::TransitionID>

The mapping of transition commitment to transition ID.

Source

type SCMMap: for<'a> Map<'a, N::TransitionID, Field<N>>

The signer commitments.

Required Methods§

Source

fn open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>

Initializes the transition storage.

Source

fn locator_map(&self) -> &Self::LocatorMap

Returns the transition program IDs and function names.

Source

fn input_store(&self) -> &InputStore<N, Self::InputStorage>

Returns the transition input store.

Source

fn output_store(&self) -> &OutputStore<N, Self::OutputStorage>

Returns the transition output store.

Source

fn tpk_map(&self) -> &Self::TPKMap

Returns the transition public keys map.

Source

fn reverse_tpk_map(&self) -> &Self::ReverseTPKMap

Returns the reverse tpk map.

Source

fn tcm_map(&self) -> &Self::TCMMap

Returns the transition commitments map.

Source

fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap

Returns the reverse tcm map.

Source

fn scm_map(&self) -> &Self::SCMMap

Returns the signer commitments map.

Provided Methods§

Source

fn storage_mode(&self) -> &StorageMode

Returns the storage mode.

Source

fn start_atomic(&self)

Starts an atomic batch write operation.

Source

fn is_atomic_in_progress(&self) -> bool

Checks if an atomic batch is in progress.

Source

fn atomic_checkpoint(&self)

Checkpoints the atomic batch.

Source

fn clear_latest_checkpoint(&self)

Clears the latest atomic batch checkpoint.

Source

fn atomic_rewind(&self)

Rewinds the atomic batch to the previous checkpoint.

Source

fn abort_atomic(&self)

Aborts an atomic batch write operation.

Source

fn finish_atomic(&self) -> Result<()>

Finishes an atomic batch write operation.

Source

fn insert(&self, transition: &Transition<N>) -> Result<()>

Stores the given transition into storage.

Source

fn remove(&self, transition_id: &N::TransitionID) -> Result<()>

Removes the input for the given transition ID.

Source

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.

Implementors§