Trait pb_jelly::PbBufferReader[][src]

pub trait PbBufferReader: Buf + Sized {
    fn split(&mut self, at: usize) -> Self;

    fn as_buffer<B: PbBuffer>(&self) -> Result<B> { ... }
}
Expand description

All concrete types which are used for deserialization should implement PbBufferReader, which includes functions to convert to and from PbBuffer.

Required methods

Advance the interal cursor by at, and return a PbBufferReader corresponding to the traversed indices (i.e. self.position..self.position + at).

Provided methods

Get a reference to the underlying PbBuffer. This is expected to be cheap, if supported, or return error. The implementation should dispatch on the type B and return an error if the requested buffer type is unknown.

Implementations on Foreign Types

Implementors