Struct miden_processor::MemAdviceProvider
source · pub struct MemAdviceProvider { /* private fields */ }
Expand description
An in-memory [AdviceProvider]
implementation to support program execution.
Uses [BTreeMap]
as backend.
Trait Implementations§
source§impl AdviceProvider for MemAdviceProvider
impl AdviceProvider for MemAdviceProvider
source§fn pop_stack(&mut self) -> Result<Felt, ExecutionError>
fn pop_stack(&mut self) -> Result<Felt, ExecutionError>
Pops an element from the advice stack and returns it. Read more
source§fn pop_stack_word(&mut self) -> Result<Word, ExecutionError>
fn pop_stack_word(&mut self) -> Result<Word, ExecutionError>
Pops a word (4 elements) from the advice stack and returns it. Read more
source§fn pop_stack_dword(&mut self) -> Result<[Word; 2], ExecutionError>
fn pop_stack_dword(&mut self) -> Result<[Word; 2], ExecutionError>
Pops a double word (8 elements) from the advice stack and returns them. Read more
source§fn push_stack(&mut self, source: AdviceSource) -> Result<(), ExecutionError>
fn push_stack(&mut self, source: AdviceSource) -> Result<(), ExecutionError>
Pushes the value(s) specified by the source onto the advice stack.
source§fn insert_into_map(
&mut self,
key: Word,
values: Vec<Felt>
) -> Result<(), ExecutionError>
fn insert_into_map( &mut self, key: Word, values: Vec<Felt> ) -> Result<(), ExecutionError>
Inserts the provided value into the advice map under the specified key. Read more
source§fn get_tree_node(
&self,
root: Word,
depth: &Felt,
index: &Felt
) -> Result<Word, ExecutionError>
fn get_tree_node( &self, root: Word, depth: &Felt, index: &Felt ) -> Result<Word, ExecutionError>
Returns a node at the specified depth and index in a Merkle tree with the given root. Read more
source§fn get_merkle_path(
&self,
root: Word,
depth: &Felt,
index: &Felt
) -> Result<MerklePath, ExecutionError>
fn get_merkle_path( &self, root: Word, depth: &Felt, index: &Felt ) -> Result<MerklePath, ExecutionError>
Returns a path to a node at the specified depth and index in a Merkle tree with the
specified root. Read more
source§fn update_merkle_node(
&mut self,
root: Word,
depth: &Felt,
index: &Felt,
value: Word
) -> Result<MerklePath, ExecutionError>
fn update_merkle_node( &mut self, root: Word, depth: &Felt, index: &Felt, value: Word ) -> Result<MerklePath, ExecutionError>
Updates a node at the specified depth and index in a Merkle tree with the specified root;
returns the Merkle path from the updated node to the new root. Read more
source§fn merge_roots(&mut self, lhs: Word, rhs: Word) -> Result<Word, ExecutionError>
fn merge_roots(&mut self, lhs: Word, rhs: Word) -> Result<Word, ExecutionError>
Creates a new Merkle tree in the advice provider by combining Merkle trees with the
specified roots. The root of the new tree is defined as
hash(left_root, right_root)
. Read moresource§fn advance_clock(&mut self)
fn advance_clock(&mut self)
Increments the clock cycle. Read more
source§impl Clone for MemAdviceProvider
impl Clone for MemAdviceProvider
source§fn clone(&self) -> MemAdviceProvider
fn clone(&self) -> MemAdviceProvider
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MemAdviceProvider
impl Debug for MemAdviceProvider
source§impl Default for MemAdviceProvider
impl Default for MemAdviceProvider
source§fn default() -> MemAdviceProvider
fn default() -> MemAdviceProvider
Returns the “default value” for a type. Read more
source§impl From<AdviceInputs> for MemAdviceProvider
impl From<AdviceInputs> for MemAdviceProvider
source§fn from(inputs: AdviceInputs) -> Self
fn from(inputs: AdviceInputs) -> Self
Converts to this type from the input type.