Struct miden_processor::StackInputs
source · pub struct StackInputs { /* private fields */ }
Expand description
Initial state of the stack to support program execution.
The program execution expects the inputs to be a stack on the VM, and it will be stored in reversed order on this struct.
Implementations§
source§impl StackInputs
impl StackInputs
pub const MAX_LEN: usize = 65_535usize
sourcepub fn new(values: Vec<BaseElement>) -> Result<StackInputs, InputError>
pub fn new(values: Vec<BaseElement>) -> Result<StackInputs, 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<StackInputs, InputError>where
I: IntoIterator<Item = u64>,
pub fn try_from_ints<I>(iter: I) -> Result<StackInputs, 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.
sourcepub fn values(&self) -> &[BaseElement]
pub fn values(&self) -> &[BaseElement]
Returns the initial stack values in stack/reversed order.
Trait Implementations§
source§impl Clone for StackInputs
impl Clone for StackInputs
source§fn clone(&self) -> StackInputs
fn clone(&self) -> StackInputs
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 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 Deserializable for StackInputs
impl Deserializable for StackInputs
source§fn read_from<R>(source: &mut R) -> Result<StackInputs, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<StackInputs, DeserializationError>where
R: ByteReader,
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<'a> IntoIterator for &'a StackInputs
impl<'a> IntoIterator for &'a StackInputs
§type Item = &'a BaseElement
type Item = &'a BaseElement
The type of the elements being iterated over.
§type IntoIter = Iter<'a, BaseElement>
type IntoIter = Iter<'a, BaseElement>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <&'a StackInputs as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a StackInputs as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
source§impl IntoIterator for StackInputs
impl IntoIterator for StackInputs
§type Item = BaseElement
type Item = BaseElement
The type of the elements being iterated over.
§type IntoIter = IntoIter<BaseElement>
type IntoIter = IntoIter<BaseElement>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <StackInputs as IntoIterator>::IntoIter
fn into_iter(self) -> <StackInputs as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
source§impl Serializable for StackInputs
impl Serializable for StackInputs
source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
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
source§impl ToElements<BaseElement> for StackInputs
impl ToElements<BaseElement> for StackInputs
fn to_elements(&self) -> Vec<BaseElement>
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