Enum ethabi::token::Token
[−]
[src]
pub enum Token { Address([u8; 20]), FixedBytes(Vec<u8>), Bytes(Vec<u8>), Int([u8; 32]), Uint([u8; 32]), Bool(bool), String(String), FixedArray(Vec<Token>), Array(Vec<Token>), }
Ethereum ABI params.
Variants
Address([u8; 20])
Address.
solidity name: address Encoded to left padded [0u8; 32].
FixedBytes(Vec<u8>)
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>)
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([u8; 32])
Signed integer.
solidity name: int
Uint([u8; 32])
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]
fn type_check(&self, param_type: &ParamType) -> bool
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.
fn to_address(self) -> Option<[u8; 20]>
Converts token to...
fn to_fixed_bytes(self) -> Option<Vec<u8>>
Converts token to...
fn to_bytes(self) -> Option<Vec<u8>>
Converts token to...
fn to_int(self) -> Option<[u8; 32]>
Converts token to...
fn to_uint(self) -> Option<[u8; 32]>
Converts token to...
fn to_bool(self) -> Option<bool>
Converts token to...
fn to_string(self) -> Option<String>
Converts token to...
fn to_fixed_array(self) -> Option<Vec<Token>>
Converts token to...
fn to_array(self) -> Option<Vec<Token>>
Converts token to...
Trait Implementations
impl Debug for Token
[src]
impl PartialEq for Token
[src]
fn eq(&self, __arg_0: &Token) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Token) -> bool
This method tests for !=
.
impl Clone for Token
[src]
fn clone(&self) -> Token
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more