Enum ethabi::token::Token  [−][src]
pub enum Token {
    Address(Address),
    FixedBytes(FixedBytes),
    Bytes(Bytes),
    Int(Uint),
    Uint(Uint),
    Bool(bool),
    String(String),
    FixedArray(Vec<Token>),
    Array(Vec<Token>),
}Ethereum ABI params.
Variants
Address(Address)Address.
solidity name: address Encoded to left padded [0u8; 32].
FixedBytes(FixedBytes)Vector of bytes with known size.
solidity name eg.: bytes8, bytes32, bytes64, bytes1024 Encoded to right padded [0u8; ((N + 31) / 32) * 32].
Bytes(Bytes)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(Uint)Signed integer.
solidity name: int
Uint(Uint)Unisnged integer.
solidity name: uint
Bool(bool)Boolean value.
solidity name: bool Encoded as left padded [0u8; 32], where last bit represents boolean value.
String(String)String.
solidity name: string Encoded in the same way as bytes. Must be utf8 compliant.
FixedArray(Vec<Token>)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>)Array of params with unknown size.
solidity name eg. int[], bool[], address[5][]
Methods
impl Token[src] 
impl Tokenpub fn type_check(&self, param_type: &ParamType) -> bool[src] 
pub fn type_check(&self, param_type: &ParamType) -> boolCheck 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<Address>[src] 
pub fn to_address(self) -> Option<Address>Converts token to...
pub fn to_fixed_bytes(self) -> Option<Vec<u8>>[src] 
pub fn to_fixed_bytes(self) -> Option<Vec<u8>>Converts token to...
pub fn to_bytes(self) -> Option<Vec<u8>>[src] 
pub fn to_bytes(self) -> Option<Vec<u8>>Converts token to...
pub fn to_int(self) -> Option<Uint>[src] 
pub fn to_int(self) -> Option<Uint>Converts token to...
pub fn to_uint(self) -> Option<Uint>[src] 
pub fn to_uint(self) -> Option<Uint>Converts token to...
pub fn to_bool(self) -> Option<bool>[src] 
pub fn to_bool(self) -> Option<bool>Converts token to...
pub fn to_string(self) -> Option<String>[src] 
pub fn to_string(self) -> Option<String>Converts token to...
pub fn to_fixed_array(self) -> Option<Vec<Token>>[src] 
pub fn to_fixed_array(self) -> Option<Vec<Token>>Converts token to...
pub fn to_array(self) -> Option<Vec<Token>>[src] 
pub fn to_array(self) -> Option<Vec<Token>>Converts token to...
pub fn types_check(tokens: &[Token], param_types: &[ParamType]) -> bool[src] 
pub fn types_check(tokens: &[Token], param_types: &[ParamType]) -> boolCheck if all the types of the tokens match the given parameter types.
Trait Implementations
impl Debug for Token[src] 
impl Debug for Tokenfn fmt(&self, f: &mut Formatter) -> Result[src] 
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Token[src] 
impl PartialEq for Tokenfn eq(&self, other: &Token) -> bool[src] 
fn eq(&self, other: &Token) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Token) -> bool[src] 
fn ne(&self, other: &Token) -> boolThis method tests for !=.
impl Clone for Token[src] 
impl Clone for Tokenfn clone(&self) -> Token[src] 
fn clone(&self) -> TokenReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src] 
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Display for Token[src] 
impl Display for Token