Enum ethane_abi::Parameter[][src]

pub enum Parameter {
    Address(H256),
    Bool(H256),
    Int(H256, usize),
    Uint(H256, usize),
    String(Vec<u8>),
    Bytes(Vec<u8>),
    FixedBytes(Vec<u8>),
    Array(Vec<Parameter>),
    FixedArray(Vec<Parameter>),
    Tuple(Vec<Parameter>),
}

An ABI function parameter type enclosing the underlying numeric data bytes.

Variants

Address(H256)
Bool(H256)
Int(H256, usize)
Uint(H256, usize)
String(Vec<u8>)
Bytes(Vec<u8>)
FixedBytes(Vec<u8>)
Array(Vec<Parameter>)
FixedArray(Vec<Parameter>)
Tuple(Vec<Parameter>)

Implementations

impl Parameter[src]

pub fn new_int(bytes: [u8; 32], signed: bool) -> Self[src]

pub fn new_fixed_bytes(bytes: &[u8]) -> Self[src]

Creates a new FixedBytes parameter.

pub fn new_bytes(bytes: &[u8]) -> Self[src]

Creates a new Bytes parameter.

impl Parameter[src]

pub fn static_encode(&self) -> Vec<u8>[src]

Encodes strictly the data part of the underlying type.

It will not check whether the parameter is dynamic or not, it simply encodes the enclosed data in place. For some types, it first writes the number of elements of the data in bytes. For further info, check the Solidity contract ABI specification.

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

Recursively checks wether a given parameter is dynamic.

For example, a Tuple can be dynamic if any of its contained types are dynamic. Additionally, a FixedArray is static if it contains values with static type and dynamic otherwise.

pub fn decode(parameter_type: &ParameterType, raw_bytes: &[u8]) -> (Self, usize)[src]

Trait Implementations

impl Clone for Parameter[src]

impl Display for Parameter[src]

impl From<&'_ str> for Parameter[src]

impl From<H160> for Parameter[src]

impl From<U128> for Parameter[src]

impl From<U256> for Parameter[src]

impl From<U64> for Parameter[src]

impl From<bool> for Parameter[src]

impl From<i128> for Parameter[src]

impl From<i16> for Parameter[src]

impl From<i32> for Parameter[src]

impl From<i64> for Parameter[src]

impl From<i8> for Parameter[src]

impl From<u128> for Parameter[src]

impl From<u16> for Parameter[src]

impl From<u32> for Parameter[src]

impl From<u64> for Parameter[src]

impl From<u8> for Parameter[src]

Auto Trait Implementations

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.