Trait xdr_codec::Pack
[−]
[src]
pub trait Pack<Out: Write> { fn pack(&self, out: &mut Out) -> Result<usize>; }
Basic packing trait.
This trait is used to implement XDR packing any Rust type into a
Write
stream. It returns the number of bytes the encoding took.
This crate provides a number of implementations for all the basic XDR types, and generated code will generally compose them to pack structures, unions, etc.
Streams generated by Pack
can be consumed by Unpack
.
Required Methods
Implementors
impl<Out: Write> Pack<Out> for u8
impl<Out: Write> Pack<Out> for u32
impl<Out: Write> Pack<Out> for i32
impl<Out: Write> Pack<Out> for u64
impl<Out: Write> Pack<Out> for i64
impl<Out: Write> Pack<Out> for f32
impl<Out: Write> Pack<Out> for f64
impl<Out: Write> Pack<Out> for bool
impl<Out: Write> Pack<Out> for ()
impl<Out: Write> Pack<Out> for usize
impl<Out: Write, T: Pack<Out>> Pack<Out> for [T]
impl<Out: Write, T: Pack<Out>> Pack<Out> for Vec<T>
impl<Out: Write> Pack<Out> for str
impl<Out: Write, T: Pack<Out>> Pack<Out> for Option<T>
impl<Out: Write, T: Pack<Out>> Pack<Out> for Box<T>
impl<'a, Out: Write, T> Pack<Out> for Cow<'a, T> where T: 'a + Pack<Out> + ToOwned<Owned=T>