jetstream::prelude

Trait WireFormat

pub trait WireFormat: Sized + Send {
    // Required methods
    fn byte_size(&self) -> u32;
    fn encode<W>(&self, writer: &mut W) -> Result<(), Error>
       where W: Write;
    fn decode<R>(reader: &mut R) -> Result<Self, Error>
       where R: Read;
}

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,

Encodes self into writer.

fn decode(reader: &mut R) -> Result<Self, Error>where R: Read,

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.

Implementations on Foreign Types

impl WireFormat for bool

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<bool, Error>where R: Read,

impl WireFormat for f32

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<f32, Error>where R: Read,

impl WireFormat for f64

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<f64, Error>where R: Read,

impl WireFormat for i16

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<i16, Error>where R: Read,

impl WireFormat for i32

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<i32, Error>where R: Read,

impl WireFormat for i64

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<i64, Error>where R: Read,

impl WireFormat for i128

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<i128, Error>where R: Read,

impl WireFormat for isize

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<isize, Error>where R: Read,

impl WireFormat for u8

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<u8, Error>where R: Read,

impl WireFormat for u16

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<u16, Error>where R: Read,

impl WireFormat for u32

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<u32, Error>where R: Read,

impl WireFormat for u64

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<u64, Error>where R: Read,

impl WireFormat for u128

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<u128, Error>where R: Read,

impl WireFormat for ()

fn byte_size(&self) -> u32

fn encode(&self, _writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(_reader: &mut R) -> Result<(), Error>where R: Read,

impl WireFormat for usize

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<usize, Error>where R: Read,

impl WireFormat for String

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<String, Error>where R: Read,

impl WireFormat for Ipv4Addr

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<Ipv4Addr, Error>where R: Read,

impl WireFormat for Ipv6Addr

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<Ipv6Addr, Error>where R: Read,

impl WireFormat for SocketAddrV4

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<SocketAddrV4, Error>where R: Read,

impl WireFormat for SocketAddrV6

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<SocketAddrV6, Error>where R: Read,

impl WireFormat for Optionwhere T: WireFormat,

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<Option, Error>where R: Read,

impl WireFormat for Vecwhere T: WireFormat,

fn byte_size(&self) -> u32

fn encode(&self, writer: &mut W) -> Result<(), Error>where W: Write,

fn decode(reader: &mut R) -> Result<Vec, Error>where R: Read,

Implementors

impl WireFormat for P9String

impl WireFormat for Dirent

impl WireFormat for Qid

impl WireFormat for Rattach

impl WireFormat for Rauth

impl WireFormat for Rerror

impl WireFormat for Rframe

impl WireFormat for Rgetattr

impl WireFormat for Rgetlock

impl WireFormat for Rlcreate

impl WireFormat for Rlerror

impl WireFormat for Rlock

impl WireFormat for Rlopen

impl WireFormat for Rmkdir

impl WireFormat for Rmknod

impl WireFormat for Rread

impl WireFormat for Rreaddir

impl WireFormat for Rstatfs

impl WireFormat for Rversion

impl WireFormat for Rwalk

impl WireFormat for Rwrite

impl WireFormat for Rxattrwalk

impl WireFormat for Tattach

impl WireFormat for Tauth

impl WireFormat for Tclunk

impl WireFormat for Tflush

impl WireFormat for Tframe

impl WireFormat for Tfsync

impl WireFormat for Tgetattr

impl WireFormat for Tgetlock

impl WireFormat for Tlcreate

impl WireFormat for Tlock

impl WireFormat for Tlopen

impl WireFormat for Tmkdir

impl WireFormat for Tmknod

impl WireFormat for Tread

impl WireFormat for Treaddir

impl WireFormat for Tremove

impl WireFormat for Trename

impl WireFormat for Trenameat

impl WireFormat for Tsetattr

impl WireFormat for Tstatfs

impl WireFormat for Tunlinkat

impl WireFormat for Tversion

impl WireFormat for Twalk

impl WireFormat for Twrite

impl WireFormat for Txattrcreate

impl WireFormat for Txattrwalk

impl WireFormat for Data

impl WireFormat for Framewhere T: Framer,