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§

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.

Required Methods§

source

fn open(dev: Option<u16>) -> 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.

Provided Methods§

source

fn dev(&self) -> Option<u16>

Returns the optional development ID.

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<N: Network> TransitionStorage<N> for TransitionMemory<N>

§

type LocatorMap = MemoryMap<<N as Network>::TransitionID, (ProgramID<N>, Identifier<N>)>

§

type InputStorage = InputMemory<N>

§

type OutputStorage = OutputMemory<N>

§

type TPKMap = MemoryMap<<N as Network>::TransitionID, Group<N>>

§

type ReverseTPKMap = MemoryMap<Group<N>, <N as Network>::TransitionID>

§

type TCMMap = MemoryMap<<N as Network>::TransitionID, Field<N>>

§

type ReverseTCMMap = MemoryMap<Field<N>, <N as Network>::TransitionID>