Enum ethane_abi::Parameter[][src]

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

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

Variants

Address(H256)
Bool(H256)
Int(H256usize)
Uint(H256usize)
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]

fn clone(&self) -> Parameter[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Display for Parameter[src]

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn from(input: &str) -> Self[src]

Performs the conversion.

impl From<EthereumType<16_usize, false>> for Parameter[src]

fn from(input: U128) -> Self[src]

Performs the conversion.

impl From<EthereumType<20_usize, true>> for Parameter[src]

fn from(input: Address) -> Self[src]

Performs the conversion.

impl From<EthereumType<32_usize, false>> for Parameter[src]

fn from(input: U256) -> Self[src]

Performs the conversion.

impl From<EthereumType<8_usize, false>> for Parameter[src]

fn from(input: U64) -> Self[src]

Performs the conversion.

impl From<bool> for Parameter[src]

fn from(input: bool) -> Self[src]

Performs the conversion.

impl From<i128> for Parameter[src]

fn from(input: i128) -> Self[src]

Performs the conversion.

impl From<i16> for Parameter[src]

fn from(input: i16) -> Self[src]

Performs the conversion.

impl From<i32> for Parameter[src]

fn from(input: i32) -> Self[src]

Performs the conversion.

impl From<i64> for Parameter[src]

fn from(input: i64) -> Self[src]

Performs the conversion.

impl From<i8> for Parameter[src]

fn from(input: i8) -> Self[src]

Performs the conversion.

impl From<u128> for Parameter[src]

fn from(input: u128) -> Self[src]

Performs the conversion.

impl From<u16> for Parameter[src]

fn from(input: u16) -> Self[src]

Performs the conversion.

impl From<u32> for Parameter[src]

fn from(input: u32) -> Self[src]

Performs the conversion.

impl From<u64> for Parameter[src]

fn from(input: u64) -> Self[src]

Performs the conversion.

impl From<u8> for Parameter[src]

fn from(input: u8) -> Self[src]

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.