Trait Column

Source
pub trait Column<T: PartialOrd = u64>: Send + Sync {
    // Required methods
    fn get_val(&self, idx: u32) -> T;
    fn min_value(&self) -> T;
    fn max_value(&self) -> T;
    fn num_vals(&self) -> u32;

    // Provided methods
    fn get_range(&self, start: u64, output: &mut [T]) { ... }
    fn get_docids_for_value_range(
        &self,
        value_range: RangeInclusive<T>,
        doc_id_range: Range<u32>,
        positions: &mut Vec<u32>,
    ) { ... }
    fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = T> + 'a> { ... }
}
Expand description

Column provides columnar access on a field.

Required Methods§

Source

fn get_val(&self, idx: u32) -> T

Return the value associated with the given idx.

This accessor should return as fast as possible.

§Panics

May panic if idx is greater than the column length.

Source

fn min_value(&self) -> T

Returns the minimum value for this fast field.

This min_value may not be exact. For instance, the min value does not take in account of possible deleted document. All values are however guaranteed to be higher than .min_value().

Source

fn max_value(&self) -> T

Returns the maximum value for this fast field.

This max_value may not be exact. For instance, the max value does not take in account of possible deleted document. All values are however guaranteed to be higher than .max_value().

Source

fn num_vals(&self) -> u32

The number of values in the column.

Provided Methods§

Source

fn get_range(&self, start: u64, output: &mut [T])

Fills an output buffer with the fast field values associated with the DocId going from start to start + output.len().

§Panics

Must panic if start + output.len() is greater than the segment’s maxdoc.

Source

fn get_docids_for_value_range( &self, value_range: RangeInclusive<T>, doc_id_range: Range<u32>, positions: &mut Vec<u32>, )

Get the positions of values which are in the provided value range.

Note that position == docid for single value fast fields

Source

fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = T> + 'a>

Returns a iterator over the data

Implementations on Foreign Types§

Source§

impl<'a, C: Column<T>, T: Copy + PartialOrd> Column<T> for &'a C

Source§

fn get_val(&self, idx: u32) -> T

Source§

fn min_value(&self) -> T

Source§

fn max_value(&self) -> T

Source§

fn num_vals(&self) -> u32

Source§

fn iter<'b>(&'b self) -> Box<dyn Iterator<Item = T> + 'b>

Source§

fn get_range(&self, start: u64, output: &mut [T])

Implementors§

Source§

impl<'a, T: Copy + PartialOrd + Send + Sync> Column<T> for VecColumn<'a, T>

Source§

impl<T> Column<<T as Iterator>::Item> for IterColumn<T>