pub trait EncoderExt {
// Required methods
fn preallocate<T>(&mut self, len: usize) -> Preallocated<'_, Self, T>;
fn encode_next_slice<T: Encode<Self>>(
&mut self,
values: &mut [T],
) -> Result<(), EncodeError>;
fn encode_next<T: Encode<Self>>(
&mut self,
value: &mut T,
) -> Result<(), EncodeError>;
}
Expand description
Extension methods for Encoder
.
Required Methods§
Sourcefn preallocate<T>(&mut self, len: usize) -> Preallocated<'_, Self, T>
fn preallocate<T>(&mut self, len: usize) -> Preallocated<'_, Self, T>
Pre-allocates space for a slice of elements.
Sourcefn encode_next_slice<T: Encode<Self>>(
&mut self,
values: &mut [T],
) -> Result<(), EncodeError>
fn encode_next_slice<T: Encode<Self>>( &mut self, values: &mut [T], ) -> Result<(), EncodeError>
Encodes a slice of elements.
Returns Err
if encoding failed.
Sourcefn encode_next<T: Encode<Self>>(
&mut self,
value: &mut T,
) -> Result<(), EncodeError>
fn encode_next<T: Encode<Self>>( &mut self, value: &mut T, ) -> Result<(), EncodeError>
Encodes a value.
Returns Err
if encoding failed.
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.