Trait Unpack

Source
pub trait Unpack<In: Read>: Sized {
    // Required method
    fn unpack(input: &mut In) -> Result<(Self, usize)>;
}
Expand description

Basic unpacking trait

This trait is used to unpack a type from an XDR encoded byte stream (encoded with Pack). It returns the decoded instance and the number of bytes consumed from the input.

This crate provides implementations for all the basic XDR types, as well as for arrays.

Required Methods§

Source

fn unpack(input: &mut In) -> Result<(Self, usize)>

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§

Source§

impl<'a, In: Read, T> Unpack<In> for Cow<'a, T>
where T: 'a + Unpack<In> + ToOwned<Owned = T>,

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for bool

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for f32

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for f64

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for i32

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for i64

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for u32

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for u64

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for ()

Source§

fn unpack(_input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for usize

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read> Unpack<In> for String

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read, T: Unpack<In>> Unpack<In> for Option<T>

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read, T: Unpack<In>> Unpack<In> for Box<T>

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Source§

impl<In: Read, T: Unpack<In>> Unpack<In> for Vec<T>

Source§

fn unpack(input: &mut In) -> Result<(Self, usize)>

Implementors§

Source§

impl<'a, In: Read> Unpack<In> for Opaque<'a>