Struct message_io::encoding::Decoder[][src]

pub struct Decoder { /* fields omitted */ }

Used to decoded one message from several/partial data chunks

Implementations

impl Decoder[src]

pub fn decode(&mut self, data: &[u8], decoded_callback: impl FnMut(&[u8]))[src]

Tries to decode data without reserve any memory, direcly from data. decoded_callback will be called for each decoded message. If data is not enough to decoding a message, the data will be stored until more data is decoded (more successives calls to this function).

pub fn stored_size(&self) -> usize[src]

Returns the bytes len stored in this decoder. It can include both, the padding bytes and the data message bytes. After decoding a message, its bytes are removed from the decoder.

Trait Implementations

impl Default for Decoder[src]

fn default() -> Decoder[src]

Creates a new decoder. It will only reserve memory in cases where decoding needs to keep data among messages.

Auto Trait Implementations

impl RefUnwindSafe for Decoder

impl Send for Decoder

impl Sync for Decoder

impl Unpin for Decoder

impl UnwindSafe for Decoder

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> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,