pub struct Stack {
pub items: Vec<RcStackValue>,
}
Expand description
A stack of values.
Fields§
§items: Vec<RcStackValue>
Implementations§
Source§impl Stack
impl Stack
pub const MAX_DEPTH: usize = 16_777_215usize
pub fn make_null() -> RcStackValue
pub fn make_nan() -> RcStackValue
pub fn make_empty_tuple() -> RcStackValue
pub fn make_zero() -> RcStackValue
pub fn make_minus_one() -> RcStackValue
pub fn make_one() -> RcStackValue
pub fn make_bool(value: bool) -> RcStackValue
Sourcepub fn load_stack_value_from_cell(cell: &DynCell) -> Result<RcStackValue, Error>
pub fn load_stack_value_from_cell(cell: &DynCell) -> Result<RcStackValue, Error>
Loads stack value from the cell. Returns an error if data was not fully used.
Sourcepub fn load_stack_value(
slice: &mut CellSlice<'_>,
) -> Result<RcStackValue, Error>
pub fn load_stack_value( slice: &mut CellSlice<'_>, ) -> Result<RcStackValue, Error>
Loads stack value from the slice advancing its cursors.
pub fn with_items(items: Vec<RcStackValue>) -> Self
pub fn depth(&self) -> usize
pub fn display_dump(&self, verbose: bool) -> impl Display + '_
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be inserted.
pub fn push<T: StackValue + 'static>(&mut self, item: T) -> VmResult<()>
pub fn push_raw<T: StackValue + ?Sized + 'static>( &mut self, item: SafeRc<T>, ) -> VmResult<()>
pub fn push_opt<T: StackValue + 'static>( &mut self, value: Option<T>, ) -> VmResult<()>
pub fn push_opt_raw<T: StackValue + ?Sized + 'static>( &mut self, item: Option<SafeRc<T>>, ) -> VmResult<()>
pub fn push_nth(&mut self, idx: usize) -> VmResult<()>
pub fn push_null(&mut self) -> VmResult<()>
pub fn push_nan(&mut self) -> VmResult<()>
pub fn push_bool(&mut self, value: bool) -> VmResult<()>
pub fn push_zero(&mut self) -> VmResult<()>
pub fn push_int<T: Into<BigInt>>(&mut self, value: T) -> VmResult<()>
pub fn push_raw_int( &mut self, value: SafeRc<BigInt>, quiet: bool, ) -> VmResult<()>
pub fn move_from_stack(&mut self, other: &mut Self, n: usize) -> VmResult<()>
pub fn split_top(&mut self, n: usize) -> VmResult<SafeRc<Self>>
pub fn split_top_ext(&mut self, n: usize, drop: usize) -> VmResult<SafeRc<Self>>
pub fn pop(&mut self) -> VmResult<RcStackValue>
pub fn pop_bool(&mut self) -> VmResult<bool>
pub fn pop_int(&mut self) -> VmResult<SafeRc<BigInt>>
pub fn pop_int_or_nan(&mut self) -> VmResult<Option<SafeRc<BigInt>>>
pub fn pop_smallint_range(&mut self, min: u32, max: u32) -> VmResult<u32>
pub fn pop_long_range(&mut self, min: u64, max: u64) -> VmResult<u64>
pub fn pop_smallint_signed_range(&mut self, min: i32, max: i32) -> VmResult<i32>
pub fn pop_smallint_signed_range_or_null( &mut self, min: i32, max: i32, ) -> VmResult<Option<i32>>
pub fn pop_tuple(&mut self) -> VmResult<SafeRc<Tuple>>
pub fn pop_tuple_range( &mut self, min_len: u32, max_len: u32, ) -> VmResult<SafeRc<Tuple>>
pub fn pop_opt_tuple_range( &mut self, min_len: u32, max_len: u32, ) -> VmResult<Option<SafeRc<Tuple>>>
pub fn pop_cont(&mut self) -> VmResult<RcCont>
pub fn pop_cs(&mut self) -> VmResult<SafeRc<OwnedCellSlice>>
pub fn pop_builder(&mut self) -> VmResult<SafeRc<CellBuilder>>
pub fn pop_cell(&mut self) -> VmResult<SafeRc<Cell>>
pub fn pop_cell_opt(&mut self) -> VmResult<Option<SafeRc<Cell>>>
pub fn pop_many(&mut self, n: usize) -> VmResult<()>
pub fn drop_bottom(&mut self, n: usize) -> VmResult<()>
pub fn swap(&mut self, lhs: usize, rhs: usize) -> VmResult<()>
pub fn reverse_range(&mut self, offset: usize, n: usize) -> VmResult<()>
pub fn fetch(&self, idx: usize) -> VmResult<&RcStackValue>
pub fn get_exit_arg(&self) -> Option<i32>
Trait Implementations§
Source§impl FromIterator<SafeRc<dyn StackValue>> for Stack
impl FromIterator<SafeRc<dyn StackValue>> for Stack
Source§fn from_iter<T: IntoIterator<Item = RcStackValue>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RcStackValue>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl SafeRcMakeMut for Stack
impl SafeRcMakeMut for Stack
fn rc_make_mut(rc: &mut Rc<Self>) -> &mut Self
Source§impl Store for Stack
impl Store for Stack
Source§fn store_into(
&self,
builder: &mut CellBuilder,
context: &dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, builder: &mut CellBuilder, context: &dyn CellContext, ) -> Result<(), Error>
Tries to store itself into the cell builder.
Auto Trait Implementations§
impl Freeze for Stack
impl !RefUnwindSafe for Stack
impl !Send for Stack
impl !Sync for Stack
impl Unpin for Stack
impl !UnwindSafe for Stack
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