pub struct OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,{ /* private fields */ }Expand description
The transition output store.
Implementations§
Source§impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
Sourcepub fn open(dev: Option<u16>) -> Result<OutputStore<N, O>, Error>
pub fn open(dev: Option<u16>) -> Result<OutputStore<N, O>, Error>
Initializes the transition output store.
Sourcepub fn from(storage: O) -> OutputStore<N, O>
pub fn from(storage: O) -> OutputStore<N, O>
Initializes a transition output store from storage.
Sourcepub fn insert(
&self,
transition_id: <N as Network>::TransitionID,
outputs: &[Output<N>],
) -> Result<(), Error>
pub fn insert( &self, transition_id: <N as Network>::TransitionID, outputs: &[Output<N>], ) -> Result<(), Error>
Stores the given (transition ID, output) pair into storage.
Sourcepub fn remove(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<(), Error>
pub fn remove( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<(), Error>
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<(), Error>
pub fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
Source§impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
Sourcepub fn get_output_ids(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Vec<Field<N>>, Error>
pub fn get_output_ids( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<Vec<Field<N>>, Error>
Returns the output IDs for the given transition ID.
Sourcepub fn get_outputs(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Vec<Output<N>>, Error>
pub fn get_outputs( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<Vec<Output<N>>, Error>
Returns the outputs for the given transition ID.
Sourcepub fn get_record(
&self,
commitment: &Field<N>,
) -> Result<Option<Record<N, Ciphertext<N>>>, Error>
pub fn get_record( &self, commitment: &Field<N>, ) -> Result<Option<Record<N, Ciphertext<N>>>, Error>
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, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
Sourcepub fn find_transition_id(
&self,
output_id: &Field<N>,
) -> Result<Option<<N as Network>::TransitionID>, Error>
pub fn find_transition_id( &self, output_id: &Field<N>, ) -> Result<Option<<N as Network>::TransitionID>, Error>
Returns the transition ID that contains the given output ID.
Source§impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
Sourcepub fn contains_output_id(&self, output_id: &Field<N>) -> Result<bool, Error>
pub fn contains_output_id(&self, output_id: &Field<N>) -> Result<bool, Error>
Returns true if the given output ID exists.
Sourcepub fn contains_commitment(&self, commitment: &Field<N>) -> Result<bool, Error>
pub fn contains_commitment(&self, commitment: &Field<N>) -> Result<bool, Error>
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.
Source§impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
impl<N, O> OutputStore<N, O>where
N: Network,
O: OutputStorage<N>,
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, I> OutputStore<N, I>where
N: Network,
I: OutputStorage<N>,
impl<N, I> OutputStore<N, I>where
N: Network,
I: OutputStorage<N>,
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, O> Clone for OutputStore<N, O>where
N: Clone + Network,
O: Clone + OutputStorage<N>,
<O as OutputStorage<N>>::ConstantMap: Clone,
<O as OutputStorage<N>>::PublicMap: Clone,
<O as OutputStorage<N>>::PrivateMap: Clone,
<O as OutputStorage<N>>::RecordMap: Clone,
<O as OutputStorage<N>>::RecordNonceMap: Clone,
<O as OutputStorage<N>>::ExternalRecordMap: Clone,
<O as OutputStorage<N>>::FutureMap: Clone,
impl<N, O> Clone for OutputStore<N, O>where
N: Clone + Network,
O: Clone + OutputStorage<N>,
<O as OutputStorage<N>>::ConstantMap: Clone,
<O as OutputStorage<N>>::PublicMap: Clone,
<O as OutputStorage<N>>::PrivateMap: Clone,
<O as OutputStorage<N>>::RecordMap: Clone,
<O as OutputStorage<N>>::RecordNonceMap: Clone,
<O as OutputStorage<N>>::ExternalRecordMap: Clone,
<O as OutputStorage<N>>::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 moreAuto Trait Implementations§
impl<N, O> Freeze for OutputStore<N, O>where
<O as OutputStorage<N>>::ConstantMap: Freeze,
<O as OutputStorage<N>>::PublicMap: Freeze,
<O as OutputStorage<N>>::PrivateMap: Freeze,
<O as OutputStorage<N>>::RecordMap: Freeze,
<O as OutputStorage<N>>::RecordNonceMap: Freeze,
<O as OutputStorage<N>>::ExternalRecordMap: Freeze,
<O as OutputStorage<N>>::FutureMap: Freeze,
O: Freeze,
impl<N, O> RefUnwindSafe for OutputStore<N, O>where
<O as OutputStorage<N>>::ConstantMap: RefUnwindSafe,
<O as OutputStorage<N>>::PublicMap: RefUnwindSafe,
<O as OutputStorage<N>>::PrivateMap: RefUnwindSafe,
<O as OutputStorage<N>>::RecordMap: RefUnwindSafe,
<O as OutputStorage<N>>::RecordNonceMap: RefUnwindSafe,
<O as OutputStorage<N>>::ExternalRecordMap: RefUnwindSafe,
<O as OutputStorage<N>>::FutureMap: RefUnwindSafe,
O: RefUnwindSafe,
impl<N, O> Send for OutputStore<N, O>
impl<N, O> Sync for OutputStore<N, O>
impl<N, O> Unpin for OutputStore<N, O>where
<O as OutputStorage<N>>::ConstantMap: Unpin,
<O as OutputStorage<N>>::PublicMap: Unpin,
<O as OutputStorage<N>>::PrivateMap: Unpin,
<O as OutputStorage<N>>::RecordMap: Unpin,
<O as OutputStorage<N>>::RecordNonceMap: Unpin,
<O as OutputStorage<N>>::ExternalRecordMap: Unpin,
<O as OutputStorage<N>>::FutureMap: Unpin,
O: Unpin,
impl<N, O> UnwindSafe for OutputStore<N, O>where
<O as OutputStorage<N>>::ConstantMap: UnwindSafe,
<O as OutputStorage<N>>::PublicMap: UnwindSafe,
<O as OutputStorage<N>>::PrivateMap: UnwindSafe,
<O as OutputStorage<N>>::RecordMap: UnwindSafe,
<O as OutputStorage<N>>::RecordNonceMap: UnwindSafe,
<O as OutputStorage<N>>::ExternalRecordMap: UnwindSafe,
<O as OutputStorage<N>>::FutureMap: UnwindSafe,
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more