[][src]Trait pb_jelly::PbBuffer

pub trait PbBuffer: Any + Clone + Default {
    type Reader: PbBufferReader;
    fn len(&self) -> usize;
fn into_reader(self) -> Self::Reader; fn from_reader<R: PbBufferReader>(reader: &mut R) -> Result<Self> { ... } }

A stand-in trait for any backing buffer store. Required to be object-safe for lazy evaluation. PbBuffers are expected to own references to the data they reference, and should be cheap (constant-time) to clone.

Associated Types

Loading content...

Required methods

fn len(&self) -> usize

fn into_reader(self) -> Self::Reader

Loading content...

Provided methods

fn from_reader<R: PbBufferReader>(reader: &mut R) -> Result<Self>

Deserialize this buffer from a reader. Unless overridden, this will error if the reader does not support casting to [Self].

Loading content...

Implementations on Foreign Types

impl PbBuffer for Bytes[src]

type Reader = Cursor<Bytes>

Loading content...

Implementors

Loading content...