[][src]Trait pb_jelly::PbBufferReader

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

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

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

Required methods

fn split(&mut self, at: usize) -> Self

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

Loading content...

Provided methods

fn as_buffer<B: PbBuffer>(&self) -> Result<B>

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.

Loading content...

Implementations on Foreign Types

impl<'a> PbBufferReader for Cursor<&'a [u8]>[src]

impl PbBufferReader for Cursor<Bytes>[src]

Loading content...

Implementors

Loading content...