[][src]Trait pb_jelly::PbBufferWriter

pub trait PbBufferWriter: Write {
    fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>;
}

All concrete types used for serialization should implement PbBufferWriter in order to support serializing lazily-evaluated types without copies.

Required methods

fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>

Attempt to write a lazily-evaluated buffer into [Self]. If the underlying [B] is not zero-copy-supported by the PbBufferWriter, this should read/copy the bytes out from [B].

Loading content...

Implementations on Foreign Types

impl<'a> PbBufferWriter for Cursor<&'a mut Vec<u8>>[src]

fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>[src]

Note: this implementation freely copies the data out of buf.

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

fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>[src]

Note: this implementation freely copies the data out of buf.

Loading content...

Implementors

impl<'a, W: Write + 'a> PbBufferWriter for CopyWriter<'a, W>[src]

fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>[src]

Note: this implementation freely copies the data out of buf.

Loading content...