Enum clarity::abi::AbiToken

source ·
pub enum AbiToken {
    Uint(Uint256),
    Int(Int256),
    Address(Address),
    Bool(bool),
    String(String),
    FixedString(String),
    Bytes(Vec<u8>),
    UnboundedBytes(Vec<u8>),
    Dynamic(Vec<AbiToken>),
    Struct(Vec<AbiToken>),
}
Expand description

A token represents a value of parameter of the contract call.

For each supported type there is separate entry that later is helpful to determine actual byte representation.

Variants§

§

Uint(Uint256)

Unsigned type with value already encoded.

§

Int(Int256)

Signed type with value already encoded.

§

Address(Address)

Ethereum Address

§

Bool(bool)

A boolean logic

§

String(String)

Represents a string

§

FixedString(String)

Represents a string encoded into a fixed size bytes32

§

Bytes(Vec<u8>)

Fixed size array of bytes

§

UnboundedBytes(Vec<u8>)

This is a dynamic array of bytes that reflects dynamic “bytes” type in Solidity

§

Dynamic(Vec<AbiToken>)

Dynamic array with supported values of supported types already converted

§

Struct(Vec<AbiToken>)

A struct to be encoded as a contract call argument

Implementations§

source§

impl AbiToken

source

pub fn serialize(&self) -> SerializedToken

Serializes a token into a SerializedToken

Trait Implementations§

source§

impl Clone for AbiToken

source§

fn clone(&self) -> AbiToken

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AbiToken

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&[Address]> for AbiToken

source§

fn from(v: &[Address]) -> AbiToken

Converts to this type from the input type.
source§

impl From<&[Int256]> for AbiToken

source§

fn from(v: &[Int256]) -> AbiToken

Converts to this type from the input type.
source§

impl From<&[Uint256]> for AbiToken

source§

fn from(v: &[Uint256]) -> AbiToken

Converts to this type from the input type.
source§

impl From<&Address> for AbiToken

source§

fn from(v: &Address) -> AbiToken

Converts to this type from the input type.
source§

impl From<&Int256> for AbiToken

source§

fn from(v: &Int256) -> AbiToken

Converts to this type from the input type.
source§

impl From<&Uint256> for AbiToken

source§

fn from(v: &Uint256) -> AbiToken

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for AbiToken

source§

fn from(v: &'a str) -> AbiToken

Converts to this type from the input type.
source§

impl From<Address> for AbiToken

source§

fn from(v: Address) -> AbiToken

Converts to this type from the input type.
source§

impl From<Int256> for AbiToken

source§

fn from(v: Int256) -> AbiToken

Converts to this type from the input type.
source§

impl From<Uint256> for AbiToken

source§

fn from(v: Uint256) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<AbiToken>> for AbiToken

source§

fn from(v: Vec<AbiToken>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<Address>> for AbiToken

source§

fn from(v: Vec<Address>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<Int256>> for AbiToken

source§

fn from(v: Vec<Int256>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<Uint256>> for AbiToken

source§

fn from(v: Vec<Uint256>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<i128>> for AbiToken

source§

fn from(v: Vec<i128>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<i16>> for AbiToken

source§

fn from(v: Vec<i16>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<i32>> for AbiToken

source§

fn from(v: Vec<i32>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<i64>> for AbiToken

source§

fn from(v: Vec<i64>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<i8>> for AbiToken

source§

fn from(v: Vec<i8>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<u128>> for AbiToken

source§

fn from(v: Vec<u128>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<u16>> for AbiToken

source§

fn from(v: Vec<u16>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<u32>> for AbiToken

source§

fn from(v: Vec<u32>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<u64>> for AbiToken

source§

fn from(v: Vec<u64>) -> AbiToken

Converts to this type from the input type.
source§

impl From<Vec<u8>> for AbiToken

source§

fn from(v: Vec<u8>) -> AbiToken

Converts to this type from the input type.
source§

impl From<bool> for AbiToken

source§

fn from(v: bool) -> AbiToken

Converts to this type from the input type.
source§

impl From<i128> for AbiToken

source§

fn from(v: i128) -> AbiToken

Converts to this type from the input type.
source§

impl From<i16> for AbiToken

source§

fn from(v: i16) -> AbiToken

Converts to this type from the input type.
source§

impl From<i32> for AbiToken

source§

fn from(v: i32) -> AbiToken

Converts to this type from the input type.
source§

impl From<i64> for AbiToken

source§

fn from(v: i64) -> AbiToken

Converts to this type from the input type.
source§

impl From<i8> for AbiToken

source§

fn from(v: i8) -> AbiToken

Converts to this type from the input type.
source§

impl From<u128> for AbiToken

source§

fn from(v: u128) -> AbiToken

Converts to this type from the input type.
source§

impl From<u16> for AbiToken

source§

fn from(v: u16) -> AbiToken

Converts to this type from the input type.
source§

impl From<u32> for AbiToken

source§

fn from(v: u32) -> AbiToken

Converts to this type from the input type.
source§

impl From<u64> for AbiToken

source§

fn from(v: u64) -> AbiToken

Converts to this type from the input type.
source§

impl From<u8> for AbiToken

source§

fn from(v: u8) -> AbiToken

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<U> As for U

source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.