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

§

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

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>,