pub enum NeoType {
Integer {
signed: bool,
bits: u16,
},
Boolean,
String,
Address,
ByteArray {
fixed_len: Option<u16>,
},
Array(Box<NeoType>),
Mapping {
key: Box<NeoType>,
value: Box<NeoType>,
},
Struct {
name: String,
fields: Vec<StructFieldType>,
},
Any,
}Expand description
Neo type representation for compiled contracts
Variants§
Implementations§
Source§impl NeoType
impl NeoType
Sourcepub fn bytes_fixed(len: u16) -> Self
pub fn bytes_fixed(len: u16) -> Self
Create a fixed-size byte array
Sourcepub fn bytes_dynamic() -> Self
pub fn bytes_dynamic() -> Self
Create a dynamic byte array
Sourcepub fn is_value_type(&self) -> bool
pub fn is_value_type(&self) -> bool
Check if this is a value type (stored by value)
Sourcepub fn is_reference_type(&self) -> bool
pub fn is_reference_type(&self) -> bool
Check if this is a reference type (stored by reference)
Sourcepub fn storage_size(&self) -> Option<usize>
pub fn storage_size(&self) -> Option<usize>
Get the storage size in bytes (for value types)
Source§impl NeoType
impl NeoType
pub fn from_solidity( ty: &str, structs: &[StructTypeMetadata], enums: &[EnumTypeMetadata], contract_types: &[String], ) -> Result<Self, TypeParseError>
Sourcepub fn from_solidity_with_aliases(
ty: &str,
structs: &[StructTypeMetadata],
enums: &[EnumTypeMetadata],
contract_types: &[String],
type_aliases: &HashMap<String, String>,
) -> Result<Self, TypeParseError>
pub fn from_solidity_with_aliases( ty: &str, structs: &[StructTypeMetadata], enums: &[EnumTypeMetadata], contract_types: &[String], type_aliases: &HashMap<String, String>, ) -> Result<Self, TypeParseError>
Resolve user-defined value type aliases before parsing.
If ty matches a key in type_aliases, the underlying type is used instead.
This makes type Price is uint256 transparent to the type system.
Trait Implementations§
impl Eq for NeoType
impl StructuralPartialEq for NeoType
Auto Trait Implementations§
impl Freeze for NeoType
impl RefUnwindSafe for NeoType
impl Send for NeoType
impl Sync for NeoType
impl Unpin for NeoType
impl UnwindSafe for NeoType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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