Trait timely::communication::Bytesable

source ·
pub trait Bytesable {
    // Required methods
    fn from_bytes(bytes: Bytes) -> Self;
    fn length_in_bytes(&self) -> usize;
    fn into_bytes<W>(&self, writer: &mut W)
       where W: Write;
}
Expand description

A type that can be serialized and deserialized through Bytes.

Required Methods§

source

fn from_bytes(bytes: Bytes) -> Self

Wrap bytes as Self.

source

fn length_in_bytes(&self) -> usize

The number of bytes required to serialize the data.

source

fn into_bytes<W>(&self, writer: &mut W)
where W: Write,

Writes the binary representation into writer.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Data> Bytesable for Bincode<T>