pub trait ArchiveSerialize: Send + 'static {
// Required method
fn encode_archive(&self, output: &mut Vec<u8>) -> Result<(), ChannelError>;
// Provided methods
fn archive_size_hint(&self) -> usize { ... }
fn archive_bytes(&self) -> Result<Vec<u8>, ChannelError> { ... }
}Expand description
Writes a value into transport-owned archive bytes.
Required Methods§
Sourcefn encode_archive(&self, output: &mut Vec<u8>) -> Result<(), ChannelError>
fn encode_archive(&self, output: &mut Vec<u8>) -> Result<(), ChannelError>
Append the archived representation to output.
Provided Methods§
Sourcefn archive_size_hint(&self) -> usize
fn archive_size_hint(&self) -> usize
Exact archive byte length when the representation is statically known from the value.
Sourcefn archive_bytes(&self) -> Result<Vec<u8>, ChannelError>
fn archive_bytes(&self) -> Result<Vec<u8>, ChannelError>
Create an owned byte buffer suitable for transport.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".