Struct aleo_rust::snarkvm_types::Execution
source · pub struct Execution<N>where
N: Network,{ /* private fields */ }
Implementations§
source§impl<N> Execution<N>where
N: Network,
impl<N> Execution<N>where N: Network,
sourcepub fn from(
transitions: impl Iterator<Item = Transition<N>>,
global_state_root: <N as Network>::StateRoot,
proof: Option<Proof<N>>
) -> Result<Execution<N>, Error>
pub fn from( transitions: impl Iterator<Item = Transition<N>>, global_state_root: <N as Network>::StateRoot, proof: Option<Proof<N>> ) -> Result<Execution<N>, Error>
Initializes a new Execution
instance with the given transitions.
sourcepub fn size_in_bytes(&self) -> Result<u64, Error>
pub fn size_in_bytes(&self) -> Result<u64, Error>
Returns the size in bytes.
sourcepub const fn global_state_root(&self) -> <N as Network>::StateRoot
pub const fn global_state_root(&self) -> <N as Network>::StateRoot
Returns the global state root.
sourcepub fn to_execution_id(&self) -> Result<Field<N>, Error>
pub fn to_execution_id(&self) -> Result<Field<N>, Error>
Returns the execution ID.
source§impl<N> Execution<N>where
N: Network,
impl<N> Execution<N>where N: Network,
sourcepub fn contains_transition(
&self,
transition_id: &<N as Network>::TransitionID
) -> bool
pub fn contains_transition( &self, transition_id: &<N as Network>::TransitionID ) -> bool
Returns true
if the execution contains the transition for the given transition ID.
sourcepub fn find_transition(
&self,
id: &<N as Network>::TransitionID
) -> Option<&Transition<N>>
pub fn find_transition( &self, id: &<N as Network>::TransitionID ) -> Option<&Transition<N>>
Returns the Transition
corresponding to the given transition ID. This method is O(1)
.
sourcepub fn get(&self, index: usize) -> Result<&Transition<N>, Error>
pub fn get(&self, index: usize) -> Result<&Transition<N>, Error>
Returns the Transition
at the given index.
sourcepub fn peek(&self) -> Result<&Transition<N>, Error>
pub fn peek(&self) -> Result<&Transition<N>, Error>
Returns the next Transition
in the execution.
sourcepub fn push(&mut self, transition: Transition<N>)
pub fn push(&mut self, transition: Transition<N>)
Appends the given Transition
to the execution.
sourcepub fn pop(&mut self) -> Result<Transition<N>, Error>
pub fn pop(&mut self) -> Result<Transition<N>, Error>
Pops the last Transition
from the execution.
source§impl<N> Execution<N>where
N: Network,
impl<N> Execution<N>where N: Network,
sourcepub fn into_transitions(self) -> impl ExactSizeIterator + DoubleEndedIterator
pub fn into_transitions(self) -> impl ExactSizeIterator + DoubleEndedIterator
Returns a consuming iterator over the underlying transitions.
sourcepub fn transitions(&self) -> impl ExactSizeIterator + DoubleEndedIterator
pub fn transitions(&self) -> impl ExactSizeIterator + DoubleEndedIterator
Returns an iterator over the underlying transitions.
sourcepub fn commitments(&self) -> impl Iterator<Item = &Field<N>>
pub fn commitments(&self) -> impl Iterator<Item = &Field<N>>
Returns an iterator over the commitments.
Trait Implementations§
source§impl<N> Clone for Execution<N>where
N: Clone + Network,
<N as Network>::TransitionID: Clone,
<N as Network>::StateRoot: Clone,
impl<N> Clone for Execution<N>where N: Clone + Network, <N as Network>::TransitionID: Clone, <N as Network>::StateRoot: Clone,
source§impl<N> Default for Execution<N>where
N: Default + Network,
<N as Network>::TransitionID: Default,
<N as Network>::StateRoot: Default,
impl<N> Default for Execution<N>where N: Default + Network, <N as Network>::TransitionID: Default, <N as Network>::StateRoot: Default,
source§impl<'de, N> Deserialize<'de> for Execution<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Execution<N>where N: Network,
source§fn deserialize<D>(
deserializer: D
) -> Result<Execution<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Execution<N>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserializes the execution from a string or bytes.
source§impl<N> PartialEq<Execution<N>> for Execution<N>where
N: PartialEq<N> + Network,
<N as Network>::TransitionID: PartialEq<<N as Network>::TransitionID>,
<N as Network>::StateRoot: PartialEq<<N as Network>::StateRoot>,
impl<N> PartialEq<Execution<N>> for Execution<N>where N: PartialEq<N> + Network, <N as Network>::TransitionID: PartialEq<<N as Network>::TransitionID>, <N as Network>::StateRoot: PartialEq<<N as Network>::StateRoot>,
source§impl<N> Serialize for Execution<N>where
N: Network,
impl<N> Serialize for Execution<N>where N: Network,
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serializes the execution into string or bytes.
impl<N> Eq for Execution<N>where N: Eq + Network, <N as Network>::TransitionID: Eq, <N as Network>::StateRoot: Eq,
impl<N> StructuralEq for Execution<N>where N: Network,
impl<N> StructuralPartialEq for Execution<N>where N: Network,
Auto Trait Implementations§
impl<N> RefUnwindSafe for Execution<N>where N: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe, <N as Network>::StateRoot: RefUnwindSafe, <N as Network>::TransitionID: RefUnwindSafe,
impl<N> Send for Execution<N>
impl<N> Sync for Execution<N>
impl<N> Unpin for Execution<N>where N: Unpin, <N as Environment>::Field: Unpin, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin, <N as Network>::StateRoot: Unpin, <N as Network>::TransitionID: Unpin,
impl<N> UnwindSafe for Execution<N>where N: UnwindSafe, <N as Environment>::Field: UnwindSafe, <<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe, <N as Environment>::Projective: UnwindSafe, <N as Environment>::Scalar: UnwindSafe, <N as Network>::StateRoot: UnwindSafe, <N as Network>::TransitionID: 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
Mutably borrows from an owned value. Read more
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.