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: Write>(&self, writer: &mut W);
}
Expand description
A type that can be serialized and deserialized through Bytes
.
Required Methods§
sourcefn from_bytes(bytes: Bytes) -> Self
fn from_bytes(bytes: Bytes) -> Self
Wrap bytes as Self
.
sourcefn length_in_bytes(&self) -> usize
fn length_in_bytes(&self) -> usize
The number of bytes required to serialize the data.
sourcefn into_bytes<W: Write>(&self, writer: &mut W)
fn into_bytes<W: Write>(&self, writer: &mut W)
Writes the binary representation into writer
.
Object Safety§
This trait is not object safe.