Struct rmp_serde::decode::Deserializer[][src]

pub struct Deserializer<R, C = DefaultConfig> { /* fields omitted */ }

A Deserializer that reads bytes from a buffer.

Note

All instances of ErrorKind::Interrupted are handled by this function and the underlying operation is retried.

Implementations

impl<R: Read> Deserializer<ReadReader<R>, DefaultConfig>[src]

pub fn new(rd: R) -> Self[src]

Constructs a new Deserializer by consuming the given reader.

impl<R: Read, C> Deserializer<ReadReader<R>, C>[src]

pub fn get_ref(&self) -> &R[src]

Gets a reference to the underlying reader in this decoder.

pub fn get_mut(&mut self) -> &mut R[src]

Gets a mutable reference to the underlying reader in this decoder.

pub fn into_inner(self) -> R[src]

Consumes this deserializer returning the underlying reader.

impl<R: Read, C: SerializerConfig> Deserializer<R, C>[src]

pub fn with_human_readable(self) -> Deserializer<R, HumanReadableConfig<C>>[src]

Consumes this deserializer and returns a new one, which will deserialize types with human-readable representations (Deserializer::is_human_readable will return true).

This is primarily useful if you need to interoperate with serializations produced by older versions of rmp-serde.

pub fn with_binary(self) -> Deserializer<R, BinaryConfig<C>>[src]

Consumes this deserializer and returns a new one, which will deserialize types with binary representations (Deserializer::is_human_readable will return false).

This is the default MessagePack deserialization mechanism, consuming the most compact representation.

impl<R: AsRef<[u8]>> Deserializer<ReadReader<Cursor<R>>>[src]

pub fn position(&self) -> u64[src]

Returns the current position of this deserializer, i.e. how many bytes were read.

impl<'de, R: ?Sized> Deserializer<ReadRefReader<'de, R>> where
    R: AsRef<[u8]>, 
[src]

pub fn from_read_ref(rd: &'de R) -> Self[src]

Constructs a new Deserializer from the given byte slice.

pub fn get_ref(&self) -> &R[src]

Gets a reference to the underlying reader in this decoder.

impl<'de, R: ReadSlice<'de>, C: SerializerConfig> Deserializer<R, C>[src]

pub fn set_max_depth(&mut self, depth: usize)[src]

Changes the maximum nesting depth that is allowed

Trait Implementations

impl<R: Debug, C: Debug> Debug for Deserializer<R, C>[src]

impl<'de, 'a, R: ReadSlice<'de>, C: SerializerConfig> Deserializer<'de> for &'a mut Deserializer<R, C>[src]

type Error = Error

The error type that can be returned if some error occurs during deserialization. Read more

Auto Trait Implementations

impl<R, C> RefUnwindSafe for Deserializer<R, C> where
    C: RefUnwindSafe,
    R: RefUnwindSafe
[src]

impl<R, C> Send for Deserializer<R, C> where
    C: Send,
    R: Send
[src]

impl<R, C> Sync for Deserializer<R, C> where
    C: Sync,
    R: Sync
[src]

impl<R, C> Unpin for Deserializer<R, C> where
    C: Unpin,
    R: Unpin
[src]

impl<R, C> UnwindSafe for Deserializer<R, C> where
    C: UnwindSafe,
    R: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.