Trait tantivy_sstable::value::ValueWriter

source ·
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§

source

type Value

Type of the value being written.

Required Methods§

source

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.

source

fn serialize_block(&self, output: &mut Vec<u8>)

Serializes the accumulated values into the output buffer.

source

fn clear(&mut self)

Clears the ValueWriter. After a call to clear, the ValueWriter should behave like a fresh ValueWriter::default().

Object Safety§

This trait is not object safe.

Implementors§