pub trait NestedEncodeOutput {
// Required method
fn write(&mut self, bytes: &[u8]);
// Provided methods
fn push_byte(&mut self, byte: u8) { ... }
fn push_specialized<T, C, F>(
&mut self,
_context: C,
_value: &T,
else_serialization: F,
) -> Result<(), EncodeError>
where T: TryStaticCast,
C: TryStaticCast,
F: FnOnce(&mut Self) -> Result<(), EncodeError> { ... }
}
Expand description
Trait that allows appending bytes. Used especially by the NestedEncode trait to output data.
In principle it can be anything, but in practice
we only keep 1 implementation, which is Vec
Required Methods§
Provided Methods§
fn push_specialized<T, C, F>( &mut self, _context: C, _value: &T, else_serialization: F, ) -> Result<(), EncodeError>
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.