Struct tantivy_sstable::Writer
source · pub struct Writer<W, TValueWriter>where
W: Write,{ /* private fields */ }
Implementations§
source§impl<W, TValueWriter> Writer<W, TValueWriter>where
W: Write,
TValueWriter: ValueWriter,
impl<W, TValueWriter> Writer<W, TValueWriter>where
W: Write,
TValueWriter: ValueWriter,
sourcepub fn set_block_len(&mut self, block_len: usize)
pub fn set_block_len(&mut self, block_len: usize)
Set the target block length.
The delta part of a block will generally be slightly larger than the requested block_len
,
however this does not account for the length of the Value part of the table.
sourcepub fn insert<K: AsRef<[u8]>>(
&mut self,
key: K,
value: &TValueWriter::Value
) -> Result<()>
pub fn insert<K: AsRef<[u8]>>( &mut self, key: K, value: &TValueWriter::Value ) -> Result<()>
Inserts a (key, value)
pair in the term dictionary.
Keys have to be inserted in order.
§Panics
Will panics if keys are inserted in an invalid order.
pub fn flush_block_if_required(&mut self) -> Result<()>
pub fn finish(self) -> Result<W>
Auto Trait Implementations§
impl<W, TValueWriter> Freeze for Writer<W, TValueWriter>
impl<W, TValueWriter> RefUnwindSafe for Writer<W, TValueWriter>where
TValueWriter: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, TValueWriter> Send for Writer<W, TValueWriter>
impl<W, TValueWriter> Sync for Writer<W, TValueWriter>
impl<W, TValueWriter> Unpin for Writer<W, TValueWriter>
impl<W, TValueWriter> UnwindSafe for Writer<W, TValueWriter>where
TValueWriter: UnwindSafe,
W: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more