pub trait DeprecatedSnippet {
Show 18 methods
// Required methods
fn entrypoint_name(&self) -> String;
fn input_field_names(&self) -> Vec<String>;
fn input_types(&self) -> Vec<DataType>;
fn output_field_names(&self) -> Vec<String>;
fn output_types(&self) -> Vec<DataType>;
fn stack_diff(&self) -> isize;
fn function_code(&self, library: &mut Library) -> String;
fn crash_conditions(&self) -> Vec<String>;
fn gen_input_states(&self) -> Vec<InitVmState>;
fn common_case_input_state(&self) -> InitVmState;
fn worst_case_input_state(&self) -> InitVmState;
fn rust_shadowing(
&self,
stack: &mut Vec<BFieldElement>,
std_in: Vec<BFieldElement>,
secret_in: Vec<BFieldElement>,
memory: &mut HashMap<BFieldElement, BFieldElement>,
);
// Provided methods
fn function_code_as_instructions(
&self,
library: &mut Library,
) -> Vec<LabelledInstruction> { ... }
fn link_for_isolated_run(&self) -> Vec<LabelledInstruction> { ... }
fn link_and_run_tasm_for_test(
&self,
stack: &mut Vec<BFieldElement>,
std_in: Vec<BFieldElement>,
nondeterminism: NonDeterminism,
) -> Result<VMState> { ... }
fn link_and_run_tasm_for_bench(
&self,
stack: &mut Vec<BFieldElement>,
std_in: Vec<BFieldElement>,
nondeterminism: NonDeterminism,
) -> Result<BenchmarkResult> { ... }
fn link_and_run_tasm_from_state_for_test(
&self,
execution_state: &mut InitVmState,
) -> VMState { ... }
fn link_and_run_tasm_from_state_for_bench(
&self,
execution_state: &mut InitVmState,
) -> Result<BenchmarkResult> { ... }
}
Required Methods§
Sourcefn entrypoint_name(&self) -> String
fn entrypoint_name(&self) -> String
The name of a Snippet
This is used as a unique identifier, e.g. when generating labels.
Sourcefn input_field_names(&self) -> Vec<String>
fn input_field_names(&self) -> Vec<String>
The input stack
fn input_types(&self) -> Vec<DataType>
Sourcefn output_field_names(&self) -> Vec<String>
fn output_field_names(&self) -> Vec<String>
The output stack
fn output_types(&self) -> Vec<DataType>
Sourcefn stack_diff(&self) -> isize
fn stack_diff(&self) -> isize
The stack difference
Sourcefn function_code(&self, library: &mut Library) -> String
fn function_code(&self, library: &mut Library) -> String
The function
Sourcefn crash_conditions(&self) -> Vec<String>
fn crash_conditions(&self) -> Vec<String>
Ways in which this snippet can crash at runtime
Sourcefn gen_input_states(&self) -> Vec<InitVmState>
fn gen_input_states(&self) -> Vec<InitVmState>
Examples of valid initial states for running this snippet
fn common_case_input_state(&self) -> InitVmState
fn worst_case_input_state(&self) -> InitVmState
fn rust_shadowing( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, secret_in: Vec<BFieldElement>, memory: &mut HashMap<BFieldElement, BFieldElement>, )
Provided Methods§
fn function_code_as_instructions( &self, library: &mut Library, ) -> Vec<LabelledInstruction>
fn link_for_isolated_run(&self) -> Vec<LabelledInstruction>
Sourcefn link_and_run_tasm_for_test(
&self,
stack: &mut Vec<BFieldElement>,
std_in: Vec<BFieldElement>,
nondeterminism: NonDeterminism,
) -> Result<VMState>
fn link_and_run_tasm_for_test( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, nondeterminism: NonDeterminism, ) -> Result<VMState>
Return Ok(vm_output_state) if execution succeeds, Err(error_message) if VM execution fails, panics if anything else goes wrong.