[][src]Enum ethers_core::abi::Token

pub enum Token {
    Address(H160),
    FixedBytes(Vec<u8>),
    Bytes(Vec<u8>),
    Int(U256),
    Uint(U256),
    Bool(bool),
    String(String),
    FixedArray(Vec<Token>),
    Array(Vec<Token>),
    Tuple(Vec<Token>),
}
This is supported on feature="abi" only.

Ethereum ABI params.

Variants

Address(H160)
This is supported on feature="abi" only.

Address.

solidity name: address Encoded to left padded [0u8; 32].

FixedBytes(Vec<u8>)
This is supported on feature="abi" only.

Vector of bytes with known size.

solidity name eg.: bytes8, bytes32, bytes64, bytes1024 Encoded to right padded [0u8; ((N + 31) / 32) * 32].

Bytes(Vec<u8>)
This is supported on feature="abi" only.

Vector of bytes of unknown size.

solidity name: bytes Encoded in two parts. Init part: offset of 'closing part`. Closing part: encoded length followed by encoded right padded bytes.

Int(U256)
This is supported on feature="abi" only.

Signed integer.

solidity name: int

Uint(U256)
This is supported on feature="abi" only.

Unisnged integer.

solidity name: uint

Bool(bool)
This is supported on feature="abi" only.

Boolean value.

solidity name: bool Encoded as left padded [0u8; 32], where last bit represents boolean value.

String(String)
This is supported on feature="abi" only.

String.

solidity name: string Encoded in the same way as bytes. Must be utf8 compliant.

FixedArray(Vec<Token>)
This is supported on feature="abi" only.

Array with known size.

solidity name eg.: int[3], bool[3], address[][8] Encoding of array is equal to encoding of consecutive elements of array.

Array(Vec<Token>)
This is supported on feature="abi" only.

Array of params with unknown size.

solidity name eg. int[], bool[], address[5][]

Tuple(Vec<Token>)
This is supported on feature="abi" only.

Tuple of params of variable types.

solidity name: tuple

Implementations

impl Token[src]

pub fn type_check(&self, param_type: &ParamType) -> bool[src]

This is supported on feature="abi" only.

Check whether the type of the token matches the given parameter type.

Numeric types (Int and Uint) type check if the size of the token type is of greater or equal size than the provided parameter type.

pub fn to_address(self) -> Option<H160>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_fixed_bytes(self) -> Option<Vec<u8>>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_bytes(self) -> Option<Vec<u8>>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_int(self) -> Option<U256>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_uint(self) -> Option<U256>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_bool(self) -> Option<bool>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_string(self) -> Option<String>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_fixed_array(self) -> Option<Vec<Token>>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn to_array(self) -> Option<Vec<Token>>[src]

This is supported on feature="abi" only.

Converts token to...

pub fn types_check(tokens: &[Token], param_types: &[ParamType]) -> bool[src]

This is supported on feature="abi" only.

Check if all the types of the tokens match the given parameter types.

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

This is supported on feature="abi" only.

Check if the token is a dynamic type resulting in prefixed encoding

Trait Implementations

impl Clone for Token[src]

impl Debug for Token[src]

impl Display for Token[src]

impl PartialEq<Token> for Token[src]

impl StructuralPartialEq for Token[src]

impl Tokenizable for Token[src]

impl TokenizableItem for Token[src]

Auto Trait Implementations

impl RefUnwindSafe for Token

impl Send for Token

impl Sync for Token

impl Unpin for Token

impl UnwindSafe for Token

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> From<T> for T[src]

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

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> ToString for T where
    T: Display + ?Sized
[src]

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>,