Trait tantivy::fastfield::FastFieldReader
[−]
[src]
pub trait FastFieldReader: Sized { type ValueType; fn get(&self, doc: DocId) -> Self::ValueType; fn get_range(&self, start: u32, output: &mut [Self::ValueType]); fn open(source: ReadOnlySource) -> Self; fn is_enabled(field_type: &FieldType) -> bool; }
Trait for accessing a fastfield.
Depending on the field type, a different fast field is required.
Associated Types
type ValueType
Type of the value stored in the fastfield.
Required Methods
fn get(&self, doc: DocId) -> Self::ValueType
Return the value associated to the given document.
This accessor should return as fast as possible.
Panics
May panic if doc
is greater than the segment
fn get_range(&self, start: u32, output: &mut [Self::ValueType])
Fills an output buffer with the fast field values
associated with the DocId
going from
start
to start + output.len()
.
Panics
May panic if start + output.len()
is greater than
the segment's maxdoc
.
fn open(source: ReadOnlySource) -> Self
Opens a fast field given a source.
fn is_enabled(field_type: &FieldType) -> bool
Returns true iff the given field_type makes it possible to access the field values via a fastfield.
Implementors
impl FastFieldReader for U64FastFieldReader type ValueType = u64;
impl FastFieldReader for I64FastFieldReader type ValueType = i64;