[][src]Struct tari_crypto::script::ExecutionStack

pub struct ExecutionStack { /* fields omitted */ }

Implementations

impl ExecutionStack[src]

pub fn new(items: Vec<StackItem>) -> Self[src]

Return a new ExecutionStack using the vector of StackItem in items

pub fn size(&self) -> usize[src]

Returns the number of entries in the execution stack

pub fn peek(&self) -> Option<&StackItem>[src]

Returns a reference to the top entry in the stack without affecting the stack

pub fn is_empty(&self) -> bool[src]

Returns true if the stack is empty

pub fn pop(&mut self) -> Option<StackItem>[src]

Pops the top item in the stack. If the stack is not empty, pop returns the item, otherwise return None if it is empty.

pub fn as_bytes(&self) -> Vec<u8>[src]

Return a binary array representation of the input stack

pub fn from_bytes(bytes: &[u8]) -> Result<Self, ScriptError>[src]

pub fn push(&mut self, item: StackItem) -> Result<(), ScriptError>[src]

Pushes the item onto the top of the stack. This function will only error if the new stack size exceeds the maximum allowed stack size, given by [MAX_STACK_SIZE]

Trait Implementations

impl Clone for ExecutionStack[src]

impl Debug for ExecutionStack[src]

impl Default for ExecutionStack[src]

impl Eq for ExecutionStack[src]

impl Hex for ExecutionStack[src]

impl PartialEq<ExecutionStack> for ExecutionStack[src]

impl StructuralEq for ExecutionStack[src]

impl StructuralPartialEq for ExecutionStack[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> Hex for T where
    T: ByteArray
[src]

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,