pub trait EncodeExt<'a>:
Sized
+ Encode
+ 'a {
// Provided methods
fn encode_iter(
items: impl Iterator<Item = &'a Self>,
buff: &mut [u8],
) -> Result<usize, Self::Error> { ... }
fn encode_buff<const N: usize>(
&self,
) -> Result<([u8; N], usize), Self::Error> { ... }
fn encode_vec(&self) -> Result<(Vec<u8>, usize), Self::Error> { ... }
}
Expand description
Extensions to Encode
trait for encodable types
Provided Methods§
Sourcefn encode_iter(
items: impl Iterator<Item = &'a Self>,
buff: &mut [u8],
) -> Result<usize, Self::Error>
fn encode_iter( items: impl Iterator<Item = &'a Self>, buff: &mut [u8], ) -> Result<usize, Self::Error>
Helper to encode iterables
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.