[][src]Struct tantivy::fastfield::IntFastFieldWriter

pub struct IntFastFieldWriter { /* fields omitted */ }

Fast field writer for ints. The fast field writer just keeps the values in memory.

Only when the segment writer can be closed and persisted on disc, the fast field writer is sent to a FastFieldSerializer via the .serialize(...) method.

We cannot serialize earlier as the values are bitpacked and the number of bits required for bitpacking can only been known once we have seen all of the values.

Both u64, and i64 use the same writer. i64 are just remapped to the 0..2^64 - 1 using common::i64_to_u64.

Methods

impl IntFastFieldWriter[src]

pub fn new(field: Field) -> IntFastFieldWriter[src]

Creates a new IntFastFieldWriter

pub fn field(&self) -> Field[src]

Returns the field that this writer is targetting.

pub fn add_val(&mut self, val: u64)[src]

Records a new value.

The n-th value being recorded is implicitely associated to the document with the DocId n. (Well, n-1 actually because of 0-indexing)

pub fn add_document(&mut self, doc: &Document)[src]

Extract the fast field value from the document (or use the default value) and records it.

pub fn serialize(&self, serializer: &mut FastFieldSerializer) -> Result<()>[src]

Push the fast fields value to the FastFieldWriter.

Auto Trait Implementations

Blanket Implementations

impl<T> Fruit for T where
    T: Send + Downcast
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]