Trait tantivy::termdict::TermDictionaryBuilder
[−]
[src]
pub trait TermDictionaryBuilder<W>: Sized where
W: Write, {
fn new(write: W, field_type: FieldType) -> Result<Self>;
fn insert<K: AsRef<[u8]>>(&mut self, key: K, value: &TermInfo) -> Result<()>;
fn finish(self) -> Result<W>;
}
Builder for the new term dictionary.
Inserting must be done in the order of the keys
.
Required Methods
fn new(write: W, field_type: FieldType) -> Result<Self>
Creates a new TermDictionaryBuilder
fn insert<K: AsRef<[u8]>>(&mut self, key: K, value: &TermInfo) -> Result<()>
Inserts a (key, value)
pair in the term dictionary.
Keys have to be inserted in order.
fn finish(self) -> Result<W>
Finalize writing the builder, and returns the underlying
Write
object.
Implementors
impl<W> TermDictionaryBuilder<W> for TermDictionaryBuilderImpl<W> where
W: Write,