[−][src]Struct runestick::Stack
The stack of the virtual machine, where all values are stored.
Implementations
impl Stack
[src]
pub const fn new() -> Self
[src]
Construct a new stack.
pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Value>,
[src]
I: IntoIterator<Item = Value>,
Extend the current stack.
pub fn with_capacity(capacity: usize) -> Self
[src]
Construct a new stack with the given capacity.
pub fn clear(&mut self)
[src]
Clear the current stack.
pub fn peek(&mut self) -> Option<&Value>
[src]
Peek the top of the stack.
pub fn last(&self) -> Result<&Value, StackError>
[src]
Get the last position on the stack.
pub fn at_offset(&self, offset: usize) -> Result<&Value, StackError>
[src]
Access the value at the given frame offset.
pub fn at_offset_mut(&mut self, offset: usize) -> Result<&mut Value, StackError>
[src]
Get the offset at the given location.
pub fn push(&mut self, value: Value)
[src]
Push an unmanaged reference.
The reference count of the value being referenced won't be modified.
pub fn pop(&mut self) -> Result<Value, StackError>
[src]
Pop a reference to a value from the stack.
pub fn popn(&mut self, count: usize) -> Result<(), StackError>
[src]
Pop the given number of elements from the stack.
pub fn is_empty(&self) -> bool
[src]
Test if the stack is empty.
pub fn len(&self) -> usize
[src]
Get the length of the stack.
pub fn iter(&self) -> impl Iterator<Item = &Value> + '_
[src]
Iterate over the stack.
pub fn pop_sequence(&mut self, count: usize) -> Result<Vec<Value>, StackError>
[src]
Pop a sequence of values from the stack.
Trait Implementations
impl Clone for Stack
[src]
impl Debug for Stack
[src]
impl From<Vec<Value>> for Stack
[src]
impl FromIterator<Value> for Stack
[src]
fn from_iter<T: IntoIterator<Item = Value>>(iter: T) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Stack
impl !Send for Stack
impl !Sync for Stack
impl Unpin for Stack
impl !UnwindSafe for Stack
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,