Trait AbiDecode

Source
pub trait AbiDecode: Sized {
    // Required method
    fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>;

    // Provided method
    fn decode_hex(data: impl AsRef<str>) -> Result<Self, AbiError> { ... }
}
Expand description

Trait for ABI decoding

Required Methods§

Source

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Decodes the ABI encoded data

Provided Methods§

Source

fn decode_hex(data: impl AsRef<str>) -> Result<Self, AbiError>

Decode hex encoded ABI encoded data

Expects a hex encoded string, with optional 0x prefix

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AbiDecode for bool

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for i8

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for i16

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for i32

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for i64

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for i128

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for u8

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for u16

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for u32

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for u64

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for u128

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for String

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for Vec<u8>

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl AbiDecode for Bytes

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A> AbiDecode for (A,)
where A: AbiType + Tokenizable,

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B> AbiDecode for (A, B)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C> AbiDecode for (A, B, C)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D> AbiDecode for (A, B, C, D)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E> AbiDecode for (A, B, C, D, E)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F> AbiDecode for (A, B, C, D, E, F)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G> AbiDecode for (A, B, C, D, E, F, G)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H> AbiDecode for (A, B, C, D, E, F, G, H)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I> AbiDecode for (A, B, C, D, E, F, G, H, I)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J> AbiDecode for (A, B, C, D, E, F, G, H, I, J)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> AbiDecode for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<T, const N: usize> AbiDecode for [T; N]

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<T: TokenizableItem + AbiArrayType> AbiDecode for Vec<T>

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Source§

impl<const N: usize> AbiDecode for [u8; N]

Source§

fn decode(bytes: impl AsRef<[u8]>) -> Result<Self, AbiError>

Implementors§