pub trait ContextualReadable: DataSize {
    type Context;

    fn read_with(
        reader: &mut impl Buf,
        context: &Self::Context
    ) -> ReadResult<Self>
    where
        Self: Sized
; }
Expand description

Allows the reading of a type from bytes given some additional Context.

Required Associated Types§

The type of context with which this type can be read from bytes.

For example, this might be usize for some collection, where that usize context represents the length of the list with which to read.

Required Methods§

Reads Self from a Buf of bytes, given some additional Context.

Implementations on Foreign Types§

Implementors§