Skip to main content

ArchiveSerialize

Trait ArchiveSerialize 

Source
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§

Source

fn encode_archive(&self, output: &mut Vec<u8>) -> Result<(), ChannelError>

Append the archived representation to output.

Provided Methods§

Source

fn archive_size_hint(&self) -> usize

Exact archive byte length when the representation is statically known from the value.

Source

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".

Implementations on Foreign Types§

Source§

impl ArchiveSerialize for String

Source§

impl ArchiveSerialize for i32

Source§

impl ArchiveSerialize for str

Implementors§