pub trait ValueWriter: Default {
type Value;
// Required methods
fn write(&mut self, val: &Self::Value);
fn serialize_block(&self, output: &mut Vec<u8>);
fn clear(&mut self);
}
Expand description
ValueWriter
is a trait to make it possible to write blocks
of value.
Required Associated Types§
Required Methods§
Sourcefn write(&mut self, val: &Self::Value)
fn write(&mut self, val: &Self::Value)
Records a new value.
This method usually just accumulates data in a Vec
,
only to be serialized on the call to ValueWriter::serialize_block
.
Sourcefn serialize_block(&self, output: &mut Vec<u8>)
fn serialize_block(&self, output: &mut Vec<u8>)
Serializes the accumulated values into the output buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.