tasm_lib::traits::deprecated_snippet

Trait DeprecatedSnippet

Source
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§

Source

fn entrypoint_name(&self) -> String

The name of a Snippet

This is used as a unique identifier, e.g. when generating labels.

Source

fn input_field_names(&self) -> Vec<String>

The input stack

Source

fn input_types(&self) -> Vec<DataType>

Source

fn output_field_names(&self) -> Vec<String>

The output stack

Source

fn output_types(&self) -> Vec<DataType>

Source

fn stack_diff(&self) -> isize

The stack difference

Source

fn function_code(&self, library: &mut Library) -> String

The function

Source

fn crash_conditions(&self) -> Vec<String>

Ways in which this snippet can crash at runtime

Source

fn gen_input_states(&self) -> Vec<InitVmState>

Examples of valid initial states for running this snippet

Source

fn common_case_input_state(&self) -> InitVmState

Source

fn worst_case_input_state(&self) -> InitVmState

Source

fn rust_shadowing( &self, stack: &mut Vec<BFieldElement>, std_in: Vec<BFieldElement>, secret_in: Vec<BFieldElement>, memory: &mut HashMap<BFieldElement, BFieldElement>, )

Provided Methods§

Source

fn function_code_as_instructions( &self, library: &mut Library, ) -> Vec<LabelledInstruction>

Return Ok(vm_output_state) if execution succeeds, Err(error_message) if VM execution fails, panics if anything else goes wrong.

Implementors§

Source§

impl DeprecatedSnippet for Isodd

Source§

impl DeprecatedSnippet for Isu32

Source§

impl DeprecatedSnippet for Leadingzeros

Source§

impl DeprecatedSnippet for Or

Source§

impl DeprecatedSnippet for Safeadd

Source§

impl DeprecatedSnippet for Safemul

Source§

impl DeprecatedSnippet for Safesub

Source§

impl DeprecatedSnippet for Shiftleft

Source§

impl DeprecatedSnippet for Shiftright

Source§

impl DeprecatedSnippet for AddU64

Source§

impl DeprecatedSnippet for AndU64

Source§

impl DeprecatedSnippet for DecrU64

Source§

impl DeprecatedSnippet for Div2U64

Source§

impl DeprecatedSnippet for DivModU64

Source§

impl DeprecatedSnippet for DoublePow2U64

Source§

impl DeprecatedSnippet for EqU64

Source§

impl DeprecatedSnippet for IncrU64

Source§

impl DeprecatedSnippet for IndexOfLastNonZeroBitU64

Source§

impl DeprecatedSnippet for LeadingZerosU64

Source§

impl DeprecatedSnippet for LtU64PreserveArgs

Source§

impl DeprecatedSnippet for MulTwoU64sToU128

Source§

impl DeprecatedSnippet for OrU64

Source§

impl DeprecatedSnippet for PopCountU64

Source§

impl DeprecatedSnippet for Pow2U64

Source§

impl DeprecatedSnippet for SafeMulU64

Source§

impl DeprecatedSnippet for ShiftLeftU64

Source§

impl DeprecatedSnippet for ShiftRightU64

Source§

impl DeprecatedSnippet for SubU64

Source§

impl DeprecatedSnippet for WrappingMulU64

Source§

impl DeprecatedSnippet for XorU64

Source§

impl DeprecatedSnippet for SafeMulU128

Source§

impl DeprecatedSnippet for ShiftLeftU128

Source§

impl DeprecatedSnippet for ShiftRightU128

Source§

impl DeprecatedSnippet for SubU128

Source§

impl DeprecatedSnippet for EqDigest

Source§

impl DeprecatedSnippet for ReverseDigest

Source§

impl DeprecatedSnippet for SwapDigest

Source§

impl DeprecatedSnippet for GetLength

Source§

impl DeprecatedSnippet for GetPointerList

Source§

impl DeprecatedSnippet for Get

Source§

impl DeprecatedSnippet for Length

Source§

impl DeprecatedSnippet for New

Source§

impl DeprecatedSnippet for Pop

Source§

impl DeprecatedSnippet for Push

Source§

impl DeprecatedSnippet for Range

Source§

impl DeprecatedSnippet for Set

Source§

impl DeprecatedSnippet for SetLength

Source§

impl DeprecatedSnippet for MemCpy

Source§

impl DeprecatedSnippet for CalculateNewPeaksFromAppend

Source§

impl DeprecatedSnippet for MmrCalculateNewPeaksFromLeafMutationMtIndices

Source§

impl DeprecatedSnippet for MmrLeafIndexToMtIndexAndPeakIndex

Source§

impl DeprecatedSnippet for MmrVerifyFromMemory

Source§

impl DeprecatedSnippet for Commit

Source§

impl DeprecatedSnippet for BfeAdd

Source§

impl<const N: u8> DeprecatedSnippet for ShiftLeftStaticU128<N>

Source§

impl<const N: u8> DeprecatedSnippet for ShiftRightStaticU128<N>