Struct snarkvm_ledger_store::OutputStore
source · pub struct OutputStore<N: Network, O: OutputStorage<N>> { /* private fields */ }
Expand description
The transition output store.
Implementations§
source§impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
sourcepub fn insert(
&self,
transition_id: N::TransitionID,
outputs: &[Output<N>]
) -> Result<()>
pub fn insert( &self, transition_id: N::TransitionID, outputs: &[Output<N>] ) -> Result<()>
Stores the given (transition ID, output)
pair into storage.
sourcepub fn remove(&self, transition_id: &N::TransitionID) -> Result<()>
pub fn remove(&self, transition_id: &N::TransitionID) -> Result<()>
Removes the output for the given transition ID
.
sourcepub fn start_atomic(&self)
pub fn start_atomic(&self)
Starts an atomic batch write operation.
sourcepub fn is_atomic_in_progress(&self) -> bool
pub fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
sourcepub fn atomic_checkpoint(&self)
pub fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
sourcepub fn clear_latest_checkpoint(&self)
pub fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
sourcepub fn atomic_rewind(&self)
pub fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
sourcepub fn abort_atomic(&self)
pub fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcepub fn finish_atomic(&self) -> Result<()>
pub fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
source§impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
sourcepub fn get_output_ids(
&self,
transition_id: &N::TransitionID
) -> Result<Vec<Field<N>>>
pub fn get_output_ids( &self, transition_id: &N::TransitionID ) -> Result<Vec<Field<N>>>
Returns the output IDs for the given transition ID
.
sourcepub fn get_outputs(
&self,
transition_id: &N::TransitionID
) -> Result<Vec<Output<N>>>
pub fn get_outputs( &self, transition_id: &N::TransitionID ) -> Result<Vec<Output<N>>>
Returns the outputs for the given transition ID
.
sourcepub fn get_record(
&self,
commitment: &Field<N>
) -> Result<Option<Record<N, Ciphertext<N>>>>
pub fn get_record( &self, commitment: &Field<N> ) -> Result<Option<Record<N, Ciphertext<N>>>>
Returns the record for the given commitment
.
If the record exists, Ok(Some(record))
is returned.
If the record was purged, Ok(None)
is returned.
If the record does not exist, Err(error)
is returned.
source§impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
sourcepub fn find_transition_id(
&self,
output_id: &Field<N>
) -> Result<Option<N::TransitionID>>
pub fn find_transition_id( &self, output_id: &Field<N> ) -> Result<Option<N::TransitionID>>
Returns the transition ID that contains the given output ID
.
source§impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
sourcepub fn contains_output_id(&self, output_id: &Field<N>) -> Result<bool>
pub fn contains_output_id(&self, output_id: &Field<N>) -> Result<bool>
Returns true
if the given output ID exists.
sourcepub fn contains_commitment(&self, commitment: &Field<N>) -> Result<bool>
pub fn contains_commitment(&self, commitment: &Field<N>) -> Result<bool>
Returns true
if the given commitment exists.
sourcepub fn contains_checksum(&self, checksum: &Field<N>) -> bool
pub fn contains_checksum(&self, checksum: &Field<N>) -> bool
Returns true
if the given checksum exists.
sourcepub fn contains_nonce(&self, nonce: &Group<N>) -> Result<bool>
pub fn contains_nonce(&self, nonce: &Group<N>) -> Result<bool>
Returns true
if the given nonce exists.
source§impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
impl<N: Network, O: OutputStorage<N>> OutputStore<N, O>
sourcepub fn output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the output IDs, for all transition outputs.
sourcepub fn constant_output_ids(
&self
) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn constant_output_ids( &self ) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the constant output IDs, for all transition outputs that are constant.
sourcepub fn public_output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn public_output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the public output IDs, for all transition outputs that are public.
sourcepub fn private_output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn private_output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the private output IDs, for all transition outputs that are private.
sourcepub fn commitments(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn commitments(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the commitments, for all transition outputs that are records.
sourcepub fn external_output_ids(
&self
) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn external_output_ids( &self ) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the external record output IDs, for all transition outputs that are external records.
sourcepub fn future_output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn future_output_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the future output IDs, for all transition outputs that are future outputs.
source§impl<N: Network, I: OutputStorage<N>> OutputStore<N, I>
impl<N: Network, I: OutputStorage<N>> OutputStore<N, I>
sourcepub fn constant_outputs(
&self
) -> impl '_ + Iterator<Item = Cow<'_, Plaintext<N>>>
pub fn constant_outputs( &self ) -> impl '_ + Iterator<Item = Cow<'_, Plaintext<N>>>
Returns an iterator over the constant outputs, for all transitions.
sourcepub fn public_outputs(&self) -> impl '_ + Iterator<Item = Cow<'_, Plaintext<N>>>
pub fn public_outputs(&self) -> impl '_ + Iterator<Item = Cow<'_, Plaintext<N>>>
Returns an iterator over the constant outputs, for all transitions.
sourcepub fn private_outputs(
&self
) -> impl '_ + Iterator<Item = Cow<'_, Ciphertext<N>>>
pub fn private_outputs( &self ) -> impl '_ + Iterator<Item = Cow<'_, Ciphertext<N>>>
Returns an iterator over the private outputs, for all transitions.
sourcepub fn checksums(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
pub fn checksums(&self) -> impl '_ + Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the checksums, for all transition outputs that are records.
sourcepub fn nonces(&self) -> impl '_ + Iterator<Item = Cow<'_, Group<N>>>
pub fn nonces(&self) -> impl '_ + Iterator<Item = Cow<'_, Group<N>>>
Returns an iterator over the nonces, for all transition outputs that are records.
sourcepub fn records(
&self
) -> impl '_ + Iterator<Item = (Cow<'_, Field<N>>, Cow<'_, Record<N, Ciphertext<N>>>)>
pub fn records( &self ) -> impl '_ + Iterator<Item = (Cow<'_, Field<N>>, Cow<'_, Record<N, Ciphertext<N>>>)>
Returns an iterator over the (commitment, record)
pairs, for all transition outputs that are records.
sourcepub fn future_outputs(&self) -> impl '_ + Iterator<Item = Cow<'_, Future<N>>>
pub fn future_outputs(&self) -> impl '_ + Iterator<Item = Cow<'_, Future<N>>>
Returns an iterator over the future outputs, for all transitions.
Trait Implementations§
source§impl<N: Clone + Network, O: Clone + OutputStorage<N>> Clone for OutputStore<N, O>where
O::ConstantMap: Clone,
O::PublicMap: Clone,
O::PrivateMap: Clone,
O::RecordMap: Clone,
O::RecordNonceMap: Clone,
O::ExternalRecordMap: Clone,
O::FutureMap: Clone,
impl<N: Clone + Network, O: Clone + OutputStorage<N>> Clone for OutputStore<N, O>where O::ConstantMap: Clone, O::PublicMap: Clone, O::PrivateMap: Clone, O::RecordMap: Clone, O::RecordNonceMap: Clone, O::ExternalRecordMap: Clone, O::FutureMap: Clone,
source§fn clone(&self) -> OutputStore<N, O>
fn clone(&self) -> OutputStore<N, O>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more