WireFormat

Trait WireFormat 

Source
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;
}
Expand description

A type that can be encoded on the wire using the 9P protocol.

Required Methods§

Source

fn byte_size(&self) -> u32

Returns the number of bytes necessary to fully encode self.

Source

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

Encodes self into writer.

Source

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

Decodes Self from reader.

Implementations on Foreign Types§

Source§

impl WireFormat for SocketAddr

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for bool

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for f32

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for f64

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for i16

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for i32

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for i64

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for i128

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for isize

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for u8

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for u16

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for u32

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for u64

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for u128

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for ()

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for usize

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for NodeAddr

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for NodeId

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for String

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for Ipv4Addr

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for Ipv6Addr

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for SocketAddrV4

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for SocketAddrV6

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl WireFormat for Url

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

§

impl WireFormat for OkId

§

fn byte_size(&self) -> u32

§

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

§

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

Source§

impl<K, V> WireFormat for BTreeMap<K, V>
where K: WireFormat + Send + Sync + Ord, V: WireFormat + Send + Sync,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

fn decode<R>(reader: &mut R) -> Result<BTreeMap<K, V>, Error>
where R: Read, BTreeMap<K, V>: Sized,

Source§

impl<T> WireFormat for Option<T>
where T: WireFormat,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl<T> WireFormat for Box<T>
where T: WireFormat,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl<T> WireFormat for Vec<T>
where T: WireFormat,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl<T> WireFormat for PhantomData<T>
where T: WireFormat,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl<V> WireFormat for BinaryHeap<V>
where V: WireFormat + Send + Sync + Ord,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl<V> WireFormat for BTreeSet<V>
where V: WireFormat + Send + Sync + Ord,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Source§

impl<V> WireFormat for VecDeque<V>
where V: WireFormat + Send + Sync + Ord,

Source§

fn byte_size(&self) -> u32

Source§

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

Source§

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

Implementors§

Source§

impl WireFormat for P9String

Source§

impl WireFormat for Dirent

Source§

impl WireFormat for Qid

Source§

impl WireFormat for Rattach

Source§

impl WireFormat for Rauth

Source§

impl WireFormat for Rerror

Source§

impl WireFormat for Rframe

Source§

impl WireFormat for Rgetattr

Source§

impl WireFormat for Rgetlock

Source§

impl WireFormat for Rlcreate

Source§

impl WireFormat for Rlerror

Source§

impl WireFormat for Rlock

Source§

impl WireFormat for Rlopen

Source§

impl WireFormat for Rmkdir

Source§

impl WireFormat for Rmknod

Source§

impl WireFormat for Rread

Source§

impl WireFormat for Rreaddir

Source§

impl WireFormat for Rstatfs

Source§

impl WireFormat for Rversion

Source§

impl WireFormat for Rwalk

Source§

impl WireFormat for Rwrite

Source§

impl WireFormat for Rxattrwalk

Source§

impl WireFormat for Tattach

Source§

impl WireFormat for Tauth

Source§

impl WireFormat for Tclunk

Source§

impl WireFormat for Tflush

Source§

impl WireFormat for Tframe

Source§

impl WireFormat for Tfsync

Source§

impl WireFormat for Tgetattr

Source§

impl WireFormat for Tgetlock

Source§

impl WireFormat for Tlcreate

Source§

impl WireFormat for Tlock

Source§

impl WireFormat for Tlopen

Source§

impl WireFormat for Tmkdir

Source§

impl WireFormat for Tmknod

Source§

impl WireFormat for Tread

Source§

impl WireFormat for Treaddir

Source§

impl WireFormat for Tremove

Source§

impl WireFormat for Trename

Source§

impl WireFormat for Trenameat

Source§

impl WireFormat for Tsetattr

Source§

impl WireFormat for Tstatfs

Source§

impl WireFormat for Tunlinkat

Source§

impl WireFormat for Tversion

Source§

impl WireFormat for Twalk

Source§

impl WireFormat for Twrite

Source§

impl WireFormat for Txattrcreate

Source§

impl WireFormat for Txattrwalk

Source§

impl WireFormat for Data

Source§

impl<P> WireFormat for ClientBuilder<P>
where P: Protocol,

Source§

impl<T> WireFormat for Frame<T>
where T: Framer,

Source§

impl<T, I> WireFormat for Wrapped<T, I>
where T: Send + AsRef<I>, I: WireFormat + Into<T>,