pub struct Execution<N: Network> { /* private fields */ }
Implementations§
Source§impl<N: Network> Execution<N>
impl<N: Network> Execution<N>
Sourcepub fn from(
transitions: impl Iterator<Item = Transition<N>>,
global_state_root: N::StateRoot,
proof: Option<Proof<N>>,
) -> Result<Self>
pub fn from( transitions: impl Iterator<Item = Transition<N>>, global_state_root: N::StateRoot, proof: Option<Proof<N>>, ) -> Result<Self>
Initializes a new Execution
instance with the given transitions.
Sourcepub fn size_in_bytes(&self) -> Result<u64>
pub fn size_in_bytes(&self) -> Result<u64>
Returns the size in bytes.
Sourcepub const fn global_state_root(&self) -> N::StateRoot
pub const fn global_state_root(&self) -> N::StateRoot
Returns the global state root.
Sourcepub fn to_execution_id(&self) -> Result<Field<N>>
pub fn to_execution_id(&self) -> Result<Field<N>>
Returns the execution ID.
Source§impl<N: Network> Execution<N>
impl<N: Network> Execution<N>
Sourcepub fn contains_transition(&self, transition_id: &N::TransitionID) -> bool
pub fn contains_transition(&self, transition_id: &N::TransitionID) -> bool
Returns true
if the execution contains the transition for the given transition ID.
Sourcepub fn get_transition(
&self,
transition_id: &N::TransitionID,
) -> Option<&Transition<N>>
pub fn get_transition( &self, transition_id: &N::TransitionID, ) -> Option<&Transition<N>>
Returns the Transition
corresponding to the given transition ID. This method is O(1)
.
Sourcepub fn get_program_id(
&self,
transition_id: &N::TransitionID,
) -> Option<&ProgramID<N>>
pub fn get_program_id( &self, transition_id: &N::TransitionID, ) -> Option<&ProgramID<N>>
Returns the program ID corresponding to the given transition ID. This method is O(1)
.
Sourcepub fn get(&self, index: usize) -> Result<&Transition<N>>
pub fn get(&self, index: usize) -> Result<&Transition<N>>
Returns the Transition
at the given index.
Sourcepub fn peek(&self) -> Result<&Transition<N>>
pub fn peek(&self) -> Result<&Transition<N>>
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>>
pub fn pop(&mut self) -> Result<Transition<N>>
Pops the last Transition
from the execution.
Source§impl<N: Network> Execution<N>
impl<N: Network> Execution<N>
Sourcepub fn into_transitions(
self,
) -> impl ExactSizeIterator + DoubleEndedIterator<Item = Transition<N>>
pub fn into_transitions( self, ) -> impl ExactSizeIterator + DoubleEndedIterator<Item = Transition<N>>
Returns a consuming iterator over the underlying transitions.
Sourcepub fn transitions(
&self,
) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &Transition<N>>
pub fn transitions( &self, ) -> impl '_ + ExactSizeIterator + DoubleEndedIterator<Item = &Transition<N>>
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<'de, N: Network> Deserialize<'de> for Execution<N>
impl<'de, N: Network> Deserialize<'de> for Execution<N>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the execution from a string or bytes.
impl<N: Eq + Network> Eq for Execution<N>
impl<N: Network> StructuralPartialEq for Execution<N>
Auto Trait Implementations§
impl<N> Freeze for Execution<N>where
<N as Network>::StateRoot: Freeze,
<N as Environment>::Field: Freeze,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Freeze,
impl<N> RefUnwindSafe for Execution<N>where
<N as Network>::StateRoot: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<N as Network>::TransitionID: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Execution<N>
impl<N> Sync for Execution<N>
impl<N> Unpin for Execution<N>where
<N as Network>::StateRoot: Unpin,
<N as Environment>::Field: Unpin,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin,
<N as Network>::TransitionID: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
N: Unpin,
impl<N> UnwindSafe for Execution<N>where
<N as Network>::StateRoot: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe,
<N as Network>::TransitionID: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
N: 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<'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 Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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