pub struct StackInputs { /* private fields */ }
Expand description
Defines the initial state of the VM’s operand stack.
The values in the struct are stored in the “stack order” - i.e., the last input is at the top of the stack (in position 0).
Implementations§
Source§impl StackInputs
impl StackInputs
Sourcepub fn new(values: Vec<Felt>) -> Result<Self, InputError>
pub fn new(values: Vec<Felt>) -> Result<Self, InputError>
Returns StackInputs from a list of values, reversing them into a stack.
§Errors
Returns an error if the number of input values exceeds the allowed maximum.
Sourcepub fn try_from_ints<I>(iter: I) -> Result<Self, InputError>where
I: IntoIterator<Item = u64>,
pub fn try_from_ints<I>(iter: I) -> Result<Self, InputError>where
I: IntoIterator<Item = u64>,
Attempts to create stack inputs from an iterator of integers.
§Errors
Returns an error if:
- The values do not represent a valid field element.
- Number of values in the iterator exceeds the allowed maximum number of input values.
Trait Implementations§
Source§impl Clone for StackInputs
impl Clone for StackInputs
Source§fn clone(&self) -> StackInputs
fn clone(&self) -> StackInputs
Returns a duplicate 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 StackInputs
impl Debug for StackInputs
Source§impl Default for StackInputs
impl Default for StackInputs
Source§fn default() -> StackInputs
fn default() -> StackInputs
Returns the “default value” for a type. Read more
Source§impl Deref for StackInputs
impl Deref for StackInputs
Source§impl Deserializable for StackInputs
impl Deserializable for StackInputs
Source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source
, attempts to deserialize these bytes
into Self
, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl From<[BaseElement; 16]> for StackInputs
impl From<[BaseElement; 16]> for StackInputs
Source§impl<'a> IntoIterator for &'a StackInputs
impl<'a> IntoIterator for &'a StackInputs
Source§impl IntoIterator for StackInputs
impl IntoIterator for StackInputs
Source§impl Serializable for StackInputs
impl Serializable for StackInputs
Source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self
into bytes and writes these bytes into the target
.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
Auto Trait Implementations§
impl Freeze for StackInputs
impl RefUnwindSafe for StackInputs
impl Send for StackInputs
impl Sync for StackInputs
impl Unpin for StackInputs
impl UnwindSafe for StackInputs
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
Mutably borrows from an owned value. Read more