pub enum StackItem {
Any,
Pointer {
value: i64,
},
Boolean {
value: bool,
},
Integer {
value: i64,
},
ByteString {
value: String,
},
Buffer {
value: String,
},
Array {
value: Vec<StackItem>,
},
Struct {
value: Vec<StackItem>,
},
Map {
value: Vec<MapEntry>,
},
InteropInterface {
id: String,
interface: String,
},
}Expand description
The StackItem enum represents an item on the Neo virtual machine stack.
Variants§
Any
Represents any type of value.
Pointer
Represents a pointer to another stack item.
Boolean
Represents a boolean value.
Integer
Represents an integer value.
ByteString
Represents a byte string value.
Buffer
Represents a buffer value.
Array
Represents an array of stack items.
Struct
Represents a struct of stack items.
Map
Represents a map of stack items.
InteropInterface
Represents an interop interface.
Implementations§
Source§impl StackItem
impl StackItem
Sourcepub const POINTER_VALUE: &'static str = "Pointer"
pub const POINTER_VALUE: &'static str = "Pointer"
The string value for StackItem::Pointer.
Sourcepub const BOOLEAN_VALUE: &'static str = "Boolean"
pub const BOOLEAN_VALUE: &'static str = "Boolean"
The string value for StackItem::Boolean.
Sourcepub const INTEGER_VALUE: &'static str = "Integer"
pub const INTEGER_VALUE: &'static str = "Integer"
The string value for StackItem::Integer.
Sourcepub const BYTE_STRING_VALUE: &'static str = "ByteString"
pub const BYTE_STRING_VALUE: &'static str = "ByteString"
The string value for StackItem::ByteString.
Sourcepub const BUFFER_VALUE: &'static str = "Buffer"
pub const BUFFER_VALUE: &'static str = "Buffer"
The string value for StackItem::Buffer.
Sourcepub const ARRAY_VALUE: &'static str = "Array"
pub const ARRAY_VALUE: &'static str = "Array"
The string value for StackItem::Array.
Sourcepub const STRUCT_VALUE: &'static str = "Struct"
pub const STRUCT_VALUE: &'static str = "Struct"
The string value for StackItem::Struct.
Sourcepub const INTEROP_INTERFACE_VALUE: &'static str = "InteropInterface"
pub const INTEROP_INTERFACE_VALUE: &'static str = "InteropInterface"
The string value for StackItem::InteropInterface.
Sourcepub const POINTER_BYTE: u8 = 16u8
pub const POINTER_BYTE: u8 = 16u8
The byte value for StackItem::Pointer.
Sourcepub const BOOLEAN_BYTE: u8 = 32u8
pub const BOOLEAN_BYTE: u8 = 32u8
The byte value for StackItem::Boolean.
Sourcepub const INTEGER_BYTE: u8 = 33u8
pub const INTEGER_BYTE: u8 = 33u8
The byte value for StackItem::Integer.
Sourcepub const BYTE_STRING_BYTE: u8 = 40u8
pub const BYTE_STRING_BYTE: u8 = 40u8
The byte value for StackItem::ByteString.
Sourcepub const BUFFER_BYTE: u8 = 48u8
pub const BUFFER_BYTE: u8 = 48u8
The byte value for StackItem::Buffer.
Sourcepub const ARRAY_BYTE: u8 = 64u8
pub const ARRAY_BYTE: u8 = 64u8
The byte value for StackItem::Array.
Sourcepub const STRUCT_BYTE: u8 = 65u8
pub const STRUCT_BYTE: u8 = 65u8
The byte value for StackItem::Struct.
Sourcepub const INTEROP_INTERFACE_BYTE: u8 = 96u8
pub const INTEROP_INTERFACE_BYTE: u8 = 96u8
The byte value for StackItem::InteropInterface.
pub fn new_byte_string(byte_array: Vec<u8>) -> Self
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns the boolean value of a StackItem::Boolean or StackItem::Integer.
Sourcepub fn as_string(&self) -> Option<String>
pub fn as_string(&self) -> Option<String>
Returns the string value of a StackItem::ByteString, StackItem::Buffer, StackItem::Integer, or StackItem::Boolean.
Sourcepub fn as_bytes(&self) -> Option<Vec<u8>>
pub fn as_bytes(&self) -> Option<Vec<u8>>
Returns the byte representation of a StackItem::ByteString, StackItem::Buffer, or StackItem::Integer.
Sourcepub fn as_array(&self) -> Option<Vec<StackItem>>
pub fn as_array(&self) -> Option<Vec<StackItem>>
Returns the array value of a StackItem::Array or StackItem::Struct.
Sourcepub fn as_int(&self) -> Option<i64>
pub fn as_int(&self) -> Option<i64>
Returns the integer value of a StackItem::Integer or StackItem::Boolean.
Sourcepub fn as_map(&self) -> Option<HashMap<StackItem, StackItem>>
pub fn as_map(&self) -> Option<HashMap<StackItem, StackItem>>
Returns the map value of a StackItem::Map.
Sourcepub fn as_address(&self) -> Option<Address>
pub fn as_address(&self) -> Option<Address>
Returns the Address value of a StackItem::ByteString or StackItem::Buffer.
Sourcepub fn as_public_key(&self) -> Option<Secp256r1PublicKey>
pub fn as_public_key(&self) -> Option<Secp256r1PublicKey>
Returns the Secp256r1PublicKey value of a StackItem::ByteString or StackItem::Buffer.
Sourcepub fn as_hash160(&self) -> Option<H160>
pub fn as_hash160(&self) -> Option<H160>
Returns the H160 value of a StackItem::ByteString or StackItem::Buffer.
Sourcepub fn as_hash256(&self) -> Option<H256>
pub fn as_hash256(&self) -> Option<H256>
Returns the H256 value of a StackItem::ByteString or StackItem::Buffer.
pub fn as_interop(&self, interface_name: &str) -> Option<StackItem>
pub fn len(&self) -> Option<usize>
pub fn is_empty(&self) -> Option<bool>
pub fn get(&self, index: usize) -> Option<StackItem>
pub fn get_iterator_id(&self) -> Option<&String>
pub fn get_interface_name(&self) -> Option<&String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StackItem
impl<'de> Deserialize<'de> for StackItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for StackItem
impl StructuralPartialEq for StackItem
Auto Trait Implementations§
impl Freeze for StackItem
impl RefUnwindSafe for StackItem
impl Send for StackItem
impl Sync for StackItem
impl Unpin for StackItem
impl UnwindSafe for StackItem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more