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 moreSource§impl Debug for InternalType
impl Debug for InternalType
Source§impl<'de> Deserialize<'de> for InternalType
impl<'de> Deserialize<'de> for InternalType
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for InternalType
impl Display for InternalType
Source§impl Hash for InternalType
impl Hash for InternalType
Source§impl PartialEq for InternalType
impl PartialEq for InternalType
Source§impl Serialize for InternalType
impl Serialize for InternalType
impl Eq for InternalType
impl StructuralPartialEq for InternalType
Auto Trait Implementations§
impl Freeze for InternalType
impl RefUnwindSafe for InternalType
impl Send for InternalType
impl Sync for InternalType
impl Unpin for InternalType
impl UnwindSafe for InternalType
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)