[−][src]Struct tantivy::fastfield::IntFastFieldWriter
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
impl Sync for IntFastFieldWriter
impl Unpin for IntFastFieldWriter
impl Send for IntFastFieldWriter
impl UnwindSafe for IntFastFieldWriter
impl RefUnwindSafe for IntFastFieldWriter
Blanket Implementations
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,