Trait AbiEncodeWith

pub trait AbiEncodeWith<Abi> {
    // Required methods
    fn encode_to_slice(&self, buffer: &mut [u8]) -> usize;
    fn encode_to_vec(&self, buffer: &mut Vec<u8>);
}
Expand description

Trait for ABI-specific encoding with support for both slice and vector buffers.

Required Methods§

fn encode_to_slice(&self, buffer: &mut [u8]) -> usize

Encodes the data into a fixed-size buffer, returning the number of bytes written.

fn encode_to_vec(&self, buffer: &mut Vec<u8>)

Encodes the data into a dynamically resizing vector.

Implementors§

§

impl<T> AbiEncodeWith<ScaleEncoding> for T
where T: Encode,

§

impl<T> AbiEncodeWith<SolEncoding> for T
where T: SolValue,