pub trait ToMidenRepr {
// Required method
fn to_bytes(&self) -> SmallVec<[u8; 16]>;
// Provided methods
fn to_felts(&self) -> SmallVec<[RawFelt; 4]> { ... }
fn to_words(&self) -> SmallVec<[Word; 1]> { ... }
fn push_to_operand_stack(&self, stack: &mut Vec<RawFelt>) { ... }
fn push_words_to_advice_stack(&self, stack: &mut Vec<RawFelt>) -> usize { ... }
}Required Methods§
Provided Methods§
Sourcefn to_felts(&self) -> SmallVec<[RawFelt; 4]>
fn to_felts(&self) -> SmallVec<[RawFelt; 4]>
Convert this type into one or more field elements, where the order of the elements is such
that the byte representation of self is in little-endian order, i.e. the least significant
bytes come first.
Sourcefn to_words(&self) -> SmallVec<[Word; 1]>
fn to_words(&self) -> SmallVec<[Word; 1]>
Convert this type into one or more words, zero-padding as needed, such that:
- The field elements within each word is in little-endian order, i.e. the least significant bytes of come first.
- Each word, if pushed on the operand stack element-by-element, would leave the element with the most significant bytes on top of the stack (including padding)
Sourcefn push_to_operand_stack(&self, stack: &mut Vec<RawFelt>)
fn push_to_operand_stack(&self, stack: &mut Vec<RawFelt>)
Push this value on the given operand stack using Self::to_felts representation
If pushing arguments for functions compiled from Wasm, consider using
push_wasm_ty_to_operand_stack instead.
Sourcefn push_words_to_advice_stack(&self, stack: &mut Vec<RawFelt>) -> usize
fn push_words_to_advice_stack(&self, stack: &mut Vec<RawFelt>) -> usize
Push this value in its Self::to_words representation, on the given stack.
This function is designed for encoding values that will be placed on the advice stack and copied into Miden VM memory by the compiler-emitted test harness.
Returns the number of words that were pushed on the stack
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".