Sitelet https://docs.rs/alloy-sol-types/latest/alloy_sol_types/trait.SolConstructor.html
Skip to main content

SolConstructor

Trait SolConstructor 

Source
pub trait SolConstructor: Sized {
    type Parameters<'a>: SolType<Token<'a> = Self::Token<'a>>;
    type Token<'a>: TokenSeq<'a>;

    // Required methods
    fn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self;
    fn tokenize(&self) -> Self::Token<'_>;

    // Provided methods
    fn abi_encoded_size(&self) -> usize { ... }
    fn abi_encode(&self) -> Vec<u8> ⓘ { ... }
}
Expand description

A Solidity constructor.

Required Associated Types§

Source

type Parameters<'a>: SolType<Token<'a> = Self::Token<'a>>

The underlying tuple type which represents this type’s arguments.

If this type has no arguments, this will be the unit type ().

Source

type Token<'a>: TokenSeq<'a>

The arguments’ corresponding TokenSeq type.

Required Methods§

Source

fn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self

Convert from the tuple type used for ABI encoding and decoding.

Source

fn tokenize(&self) -> Self::Token<'_>

Tokenize the call’s arguments.

Provided Methods§

Source

fn abi_encoded_size(&self) -> usize

The size of the encoded data in bytes.

Source

fn abi_encode(&self) -> Vec<u8> ⓘ

ABI encode the call to the given buffer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§