pub enum InternalType {
AddressPayable(String),
Contract(String),
Enum {
contract: Option<String>,
ty: String,
},
Struct {
contract: Option<String>,
ty: String,
},
Other {
contract: Option<String>,
ty: String,
},
}Expand description
The contract internal type. This could be a regular Solidity type, a user-defined type, an enum, a struct, a contract, or an address payable.
The internal type represents the Solidity definition of the type, stripped of the memory or storage keywords. It is used to convey the application dev and user-facing type, while the json param “type” field is used to convey the underlying ABI type.
Variants§
AddressPayable(String)
Address payable.
Contract(String)
Contract.
Enum
Enum. Possibly of the form contract.enum.
Struct
Struct. Possibly of the form contract.struct.
Other
Other. Possible of the form contract.other.
Implementations§
Source§impl InternalType
impl InternalType
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse a string into an instance, taking ownership of data
Sourcepub const fn is_contract(&self) -> bool
pub const fn is_contract(&self) -> bool
True if the instance is a contract variant.
Sourcepub const fn is_address_payable(&self) -> bool
pub const fn is_address_payable(&self) -> bool
True if the instance is a address payable variant.
Sourcepub fn as_contract(&self) -> Option<&str>
pub fn as_contract(&self) -> Option<&str>
Fallible conversion to a variant.
Sourcepub fn struct_specifier(&self) -> Option<TypeSpecifier<'_>>
pub fn struct_specifier(&self) -> Option<TypeSpecifier<'_>>
Return a TypeSpecifier describing the struct if this type is a
struct.
Sourcepub fn enum_specifier(&self) -> Option<TypeSpecifier<'_>>
pub fn enum_specifier(&self) -> Option<TypeSpecifier<'_>>
Return a TypeSpecifier describing the enum if this type is an enum.
Sourcepub fn contract_specifier(&self) -> Option<TypeSpecifier<'_>>
pub fn contract_specifier(&self) -> Option<TypeSpecifier<'_>>
Return a TypeSpecifier describing the contract if this type is a
contract.
Sourcepub fn other_specifier(&self) -> Option<TypeSpecifier<'_>>
pub fn other_specifier(&self) -> Option<TypeSpecifier<'_>>
Return a TypeSpecifier describing the other if this type is an
other. An “other” specifier indicates EITHER a regular Solidity type OR
a user-defined type. It is not possible to distinguish between the two
without additional context.
Trait Implementations§
Source§impl Clone for InternalType
impl Clone for InternalType
Source§fn clone(&self) -> InternalType
fn clone(&self) -> InternalType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more