Trait Unpack

Source
pub trait Unpack: Sized {
    // Required method
    fn decode_body<T: Read>(
        marker: Marker,
        reader: &mut T,
    ) -> Result<Self, DecodeError>;

    // Provided method
    fn decode<T: Read>(reader: &mut T) -> Result<Self, DecodeError> { ... }
}
Expand description

Trait to decode values from a stream using PackStream.

Required Methods§

Source

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Provided Methods§

Source

fn decode<T: Read>(reader: &mut T) -> Result<Self, DecodeError>

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 Unpack for bool

Source§

fn decode_body<T: Read>(marker: Marker, _: &mut T) -> Result<Self, DecodeError>

Source§

impl Unpack for f64

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl Unpack for i32

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl Unpack for i64

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl Unpack for String

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl<P: Unpack + Hash + Eq> Unpack for HashSet<P>

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl<P: Unpack> Unpack for Option<P>

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl<P: Unpack> Unpack for Vec<P>

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Source§

impl<P: Unpack> Unpack for HashMap<String, P>

Source§

fn decode_body<T: Read>( marker: Marker, reader: &mut T, ) -> Result<Self, DecodeError>

Implementors§