pub trait AbiEncodeWith<Abi> {
// Required methods
fn encode_with(&self) -> Vec<u8> ⓘ;
fn encode_to_slice(&self, buffer: &mut [u8]) -> usize;
fn encode_to_vec(&self, buffer: &mut Vec<u8>);
fn encode_topic<H>(&self, hasher: H) -> [u8; 32]
where H: Fn(&[u8], &mut [u8; 32]);
}
Expand description
Trait for ABI-specific encoding with support for both slice and vector buffers.
Required Methods§
Sourcefn encode_with(&self) -> Vec<u8> ⓘ
fn encode_with(&self) -> Vec<u8> ⓘ
Encodes the data into a new vector.
Sourcefn encode_to_slice(&self, buffer: &mut [u8]) -> usize
fn encode_to_slice(&self, buffer: &mut [u8]) -> usize
Encodes the data into a fixed-size buffer, returning the number of bytes written.
Sourcefn encode_to_vec(&self, buffer: &mut Vec<u8>)
fn encode_to_vec(&self, buffer: &mut Vec<u8>)
Encodes the data into a dynamically resizing vector.
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.