Trait alloy_dyn_abi::JsonAbiExt

source ·
pub trait JsonAbiExt: Sealed {
    // Required methods
    fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>;
    fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>;
    fn abi_decode_input(
        &self,
        data: &[u8],
        validate: bool
    ) -> Result<Vec<DynSolValue>>;
}
Expand description

Provides ABI encoding and decoding functionality.

This trait is sealed and cannot be implemented for types outside of this crate. It is implemented only for the following types:

Required Methods§

source

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

ABI-encodes the given values, prefixed by this item’s selector, if any.

The selector is:

This behaviour is to ensure consistency with ethabi.

To encode the data without the selector, use abi_encode_input_raw.

§Errors

This function will return an error if the given values do not match the expected input types.

source

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

ABI-encodes the given values, without prefixing the data with the item’s selector.

For Constructor, this is the same as abi_encode_input.

§Errors

This function will return an error if the given values do not match the expected input types.

source

fn abi_decode_input( &self, data: &[u8], validate: bool ) -> Result<Vec<DynSolValue>>

ABI-decodes the given data according to this item’s input types.

§Errors

This function will return an error if the decoded data does not match the expected input types.

Implementations on Foreign Types§

source§

impl JsonAbiExt for Constructor

source§

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

source§

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

source§

fn abi_decode_input( &self, data: &[u8], validate: bool ) -> Result<Vec<DynSolValue>>

source§

impl JsonAbiExt for Error

source§

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

source§

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

source§

fn abi_decode_input( &self, data: &[u8], validate: bool ) -> Result<Vec<DynSolValue>>

source§

impl JsonAbiExt for Function

source§

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

source§

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

source§

fn abi_decode_input( &self, data: &[u8], validate: bool ) -> Result<Vec<DynSolValue>>

Implementors§