Struct snarkvm_debug::prelude::store::InputStore
pub struct InputStore<N, I>where
N: Network,
I: InputStorage<N>,{ /* private fields */ }Expand description
The transition input store.
Implementations§
§impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
pub fn open(dev: Option<u16>) -> Result<InputStore<N, I>, Error>
pub fn open(dev: Option<u16>) -> Result<InputStore<N, I>, Error>
Initializes the transition input store.
pub fn from(storage: I) -> InputStore<N, I>
pub fn from(storage: I) -> InputStore<N, I>
Initializes a transition input store from storage.
pub fn insert(
&self,
transition_id: <N as Network>::TransitionID,
inputs: &[Input<N>]
) -> Result<(), Error>
pub fn insert( &self, transition_id: <N as Network>::TransitionID, inputs: &[Input<N>] ) -> Result<(), Error>
Stores the given (transition ID, input) pair into storage.
pub 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 input for the given transition ID.
pub fn start_atomic(&self)
pub fn start_atomic(&self)
Starts an atomic batch write operation.
pub fn is_atomic_in_progress(&self) -> bool
pub fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
pub fn atomic_checkpoint(&self)
pub fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
pub fn clear_latest_checkpoint(&self)
pub fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
pub fn atomic_rewind(&self)
pub fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
pub fn abort_atomic(&self)
pub fn abort_atomic(&self)
Aborts an atomic batch write operation.
pub fn finish_atomic(&self) -> Result<(), Error>
pub fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
§impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
pub fn get_input_ids(
&self,
transition_id: &<N as Network>::TransitionID
) -> Result<Vec<Field<N>>, Error>
pub fn get_input_ids( &self, transition_id: &<N as Network>::TransitionID ) -> Result<Vec<Field<N>>, Error>
Returns the input IDs for the given transition ID.
pub fn get_inputs(
&self,
transition_id: &<N as Network>::TransitionID
) -> Result<Vec<Input<N>>, Error>
pub fn get_inputs( &self, transition_id: &<N as Network>::TransitionID ) -> Result<Vec<Input<N>>, Error>
Returns the inputs for the given transition ID.
§impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
pub fn find_transition_id(
&self,
input_id: &Field<N>
) -> Result<Option<<N as Network>::TransitionID>, Error>
pub fn find_transition_id( &self, input_id: &Field<N> ) -> Result<Option<<N as Network>::TransitionID>, Error>
Returns the transition ID that contains the given input ID.
§impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
pub fn contains_input_id(&self, input_id: &Field<N>) -> Result<bool, Error>
pub fn contains_input_id(&self, input_id: &Field<N>) -> Result<bool, Error>
Returns true if the given input ID exists.
pub fn contains_serial_number(
&self,
serial_number: &Field<N>
) -> Result<bool, Error>
pub fn contains_serial_number( &self, serial_number: &Field<N> ) -> Result<bool, Error>
Returns true if the given serial number exists.
pub fn contains_tag(&self, tag: &Field<N>) -> Result<bool, Error>
pub fn contains_tag(&self, tag: &Field<N>) -> Result<bool, Error>
Returns true if the given tag exists.
§impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
pub fn input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
pub fn input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the input IDs, for all transition inputs.
pub fn constant_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
pub fn constant_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the constant input IDs, for all transition inputs that are constant.
pub fn public_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
pub fn public_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the public input IDs, for all transition inputs that are public.
pub fn private_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
pub fn private_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the private input IDs, for all transition inputs that are private.
pub fn serial_numbers(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
pub fn serial_numbers(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the serial numbers, for all transition inputs that are records.
pub fn external_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
pub fn external_input_ids(&self) -> impl Iterator<Item = Cow<'_, Field<N>>>
Returns an iterator over the external record input IDs, for all transition inputs that are external records.
§impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
impl<N, I> InputStore<N, I>where
N: Network,
I: InputStorage<N>,
pub fn constant_inputs(&self) -> impl Iterator<Item = Cow<'_, Plaintext<N>>>
pub fn constant_inputs(&self) -> impl Iterator<Item = Cow<'_, Plaintext<N>>>
Returns an iterator over the constant inputs, for all transitions.
pub fn public_inputs(&self) -> impl Iterator<Item = Cow<'_, Plaintext<N>>>
pub fn public_inputs(&self) -> impl Iterator<Item = Cow<'_, Plaintext<N>>>
Returns an iterator over the constant inputs, for all transitions.
pub fn private_inputs(&self) -> impl Iterator<Item = Cow<'_, Ciphertext<N>>>
pub fn private_inputs(&self) -> impl Iterator<Item = Cow<'_, Ciphertext<N>>>
Returns an iterator over the private inputs, for all transitions.
Returns an iterator over the tags, for all transition inputs that are records.
Trait Implementations§
§impl<N, I> Clone for InputStore<N, I>where
N: Clone + Network,
I: Clone + InputStorage<N>,
<I as InputStorage<N>>::ConstantMap: Clone,
<I as InputStorage<N>>::PublicMap: Clone,
<I as InputStorage<N>>::PrivateMap: Clone,
<I as InputStorage<N>>::RecordMap: Clone,
<I as InputStorage<N>>::RecordTagMap: Clone,
<I as InputStorage<N>>::ExternalRecordMap: Clone,
impl<N, I> Clone for InputStore<N, I>where
N: Clone + Network,
I: Clone + InputStorage<N>,
<I as InputStorage<N>>::ConstantMap: Clone,
<I as InputStorage<N>>::PublicMap: Clone,
<I as InputStorage<N>>::PrivateMap: Clone,
<I as InputStorage<N>>::RecordMap: Clone,
<I as InputStorage<N>>::RecordTagMap: Clone,
<I as InputStorage<N>>::ExternalRecordMap: Clone,
§fn clone(&self) -> InputStore<N, I>
fn clone(&self) -> InputStore<N, I>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more