pub struct VM;Implementations§
Source§impl VM
impl VM
Sourcepub fn run(
program: Program,
public_input: PublicInput,
non_determinism: NonDeterminism,
) -> Result<Vec<BFieldElement>, VMError>
pub fn run( program: Program, public_input: PublicInput, non_determinism: NonDeterminism, ) -> Result<Vec<BFieldElement>, VMError>
Run Triton VM on the Program with the given public input and
non-determinism. If an error is encountered, the returned
VMError contains the VMState at the point of execution
failure.
See also trace_execution and profile.
Sourcepub fn trace_execution(
program: Program,
public_input: PublicInput,
non_determinism: NonDeterminism,
) -> Result<(AlgebraicExecutionTrace, Vec<BFieldElement>), VMError>
pub fn trace_execution( program: Program, public_input: PublicInput, non_determinism: NonDeterminism, ) -> Result<(AlgebraicExecutionTrace, Vec<BFieldElement>), VMError>
Sourcepub fn trace_execution_of_state(
state: VMState,
) -> Result<(AlgebraicExecutionTrace, VMState), VMError>
pub fn trace_execution_of_state( state: VMState, ) -> Result<(AlgebraicExecutionTrace, VMState), VMError>
Trace the execution of a Program from a given VMState. Consider
using trace_execution, unless you know this
is what you want.
Returns the AlgebraicExecutionTrace and the terminal VMState if
execution succeeds.
Sourcepub fn profile(
program: Program,
public_input: PublicInput,
non_determinism: NonDeterminism,
) -> Result<(Vec<BFieldElement>, ExecutionTraceProfile), VMError>
pub fn profile( program: Program, public_input: PublicInput, non_determinism: NonDeterminism, ) -> Result<(Vec<BFieldElement>, ExecutionTraceProfile), VMError>
Run Triton VM with the given public and secret input, recording the
influence of a callable block of instructions on the
AlgebraicExecutionTrace. For example, this can be used to identify
the number of clock cycles spent in some block of instructions, or
how many rows that block of instructions contributes to the U32 Table.
See also run and trace_execution.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for VM
impl<'arbitrary> Arbitrary<'arbitrary> for VM
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl<'de> Deserialize<'de> for VM
impl<'de> Deserialize<'de> for VM
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for VM
impl Eq for VM
impl StructuralPartialEq for VM
Auto Trait Implementations§
impl Freeze for VM
impl RefUnwindSafe for VM
impl Send for VM
impl Sync for VM
impl Unpin for VM
impl UnwindSafe for VM
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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