Trait pb_jelly::PbBuffer[][src]

pub trait PbBuffer: Any + Sized {
    fn len(&self) -> usize;
fn copy_to_writer<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>;
fn copy_from_reader<B: Buf + ?Sized>(reader: &mut B) -> Result<Self>; }
Expand description

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

Required methods

Returns the length of the data contained in this buffer.

Fallback method to read the contents of self. This method is expected to write exactly self.len() bytes into writer, or fail with an error.

This method is used to write Lazy fields to incompatible PbBufferWriters.

Fallback method to create an instance of this PbBuffer.

This method is used to read Lazy fields from incompatible PbBufferReaders.

Implementations on Foreign Types

Implementors