jetstream::prelude
Trait WireFormat
pub trait WireFormat: Send {
// Required methods
fn byte_size(&self) -> u32;
fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write,
Self: Sized;
fn decode<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,
Self: Sized;
}
A type that can be encoded on the wire using the 9P protocol.
Required Methods
fn byte_size(&self) -> u32
Returns the number of bytes necessary to fully encode self
.
fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write, Self: Sized,
Encodes self
into writer
.
fn decode(reader: &mut R) -> Result<Self, Error>where R: Read, Self: Sized,
Decodes Self
from reader
.