jetstream_wireformat
Trait WireFormat
pub trait WireFormat: Send {
// Required methods
fn byte_size(&self) -> u32;
fn encode<W: Write>(&self, writer: &mut W) -> Result<()>
where Self: Sized;
fn decode<R: Read>(reader: &mut R) -> Result<Self>
where 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<W: Write>(&self, writer: &mut W) -> Result<()>where Self: Sized,
Encodes self
into writer
.
fn decode<R: Read>(reader: &mut R) -> Resultwhere Self: Sized,
Decodes Self
from reader
.