jetstream_wireformat
Trait WireFormat
pub trait WireFormat: Sized + Send {
// Required methods
fn byte_size(&self) -> u32;
fn encode<W: Write>(&self, writer: &mut W) -> Result<()>;
fn decode<R: Read>(reader: &mut R) -> Result<Self>;
}
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<()>
Encodes self
into writer
.
fn decode<R: Read>(reader: &mut R) -> Result
Decodes Self
from reader
.
Dyn Compatibility
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.