Trait pb_jelly::PbBufferWriter
source · pub trait PbBufferWriter: Write {
// Required method
fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>;
}
Expand description
All concrete types used for serialization should implement PbBufferWriter in order to support serializing Lazy fields without copies.
Required Methods§
sourcefn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>
fn write_buffer<B: PbBuffer>(&mut self, buf: &B) -> Result<()>
Attempt to write a zerocopy buffer into self
. If B
is not zero-copy-supported
by the PbBufferWriter, this may read/copy the bytes out from buf
.
Object Safety§
This trait is not object safe.