Skip to main content

MmapIndexReader

Struct MmapIndexReader 

Source
pub struct MmapIndexReader {
    pub doc_count: u32,
    pub field_length_sums: [u64; 6],
    pub term_count: u32,
    /* private fields */
}
Expand description

Memory-mapped reader over one corpus-hash store directory (the base).

Fields§

§doc_count: u32§field_length_sums: [u64; 6]§term_count: u32

Implementations§

Source§

impl MmapIndexReader

Source

pub fn open( directory: &Path, corpus_hash: &str, bundle_version: &str, ) -> Result<Self, IndexFormatError>

Source

pub fn identity_entry(&self, docid: u32) -> Result<IndexEntry, IndexFormatError>

The lightweight identity row (no sections, no inbound).

Source

pub fn full_entry(&self, docid: u32) -> Result<IndexEntry, IndexFormatError>

The full index row: identity plus searchable sections and inbound.

Source

pub fn entry_path(&self, docid: u32) -> Result<String, IndexFormatError>

Source

pub fn entry_status(&self, docid: u32) -> Result<String, IndexFormatError>

The first non-empty line of this document’s ## Status section. Status is already present in the searchable-section segment, so grounding can determine lifecycle without reopening and reparsing the Markdown file.

Source

pub fn field_lengths(&self, docid: u32) -> Result<[u64; 6], IndexFormatError>

Per-field token counts for one doc, FIELDS order.

Source

pub fn forward_token_ids( &self, docid: u32, ) -> Result<[Vec<u32>; 6], IndexFormatError>

The six forward token-id sequences of one doc, FIELDS order.

Source

pub fn term_at(&self, term_id: u32) -> Result<String, IndexFormatError>

Source

pub fn field_tokens(&self, docid: u32) -> Result<FieldTokens, IndexFormatError>

Reconstruct one doc’s per-field token vectors in document order.

Source

pub fn prefix_range(&self, term: &str) -> Result<(u32, u32), IndexFormatError>

The [lo, hi) term-id range of every indexed term term prefixes.

Source

pub fn postings(&self, term_id: u32) -> Result<Vec<u32>, IndexFormatError>

The ascending docids that hold term_id in any field.

Source

pub fn prefix_docids( &self, term: &str, ) -> Result<BTreeSet<u32>, IndexFormatError>

Distinct docids matching term under the prefix predicate (ADR-037).

Source

pub fn alias_docids(&self, wanted: &str) -> Result<Vec<u32>, IndexFormatError>

The ascending docids whose identity set holds wanted (already casefolded by the caller) — binary search over the alias map.

Source

pub fn docid_for_path( &self, path: &str, ) -> Result<Option<u32>, IndexFormatError>

The docid whose stored path equals path, or None — binary search.

Source

pub fn relationships(&self) -> Result<Vec<Relationship>, IndexFormatError>

Source

pub fn live_decision_paths(&self) -> Result<Vec<String>, IndexFormatError>

Source

pub fn scope_rows(&self) -> Result<Vec<ScopeRow>, IndexFormatError>

Source

pub fn portfolio_summary(&self) -> Result<Value, IndexFormatError>

The portfolio summary parsed back from its stored JSON text.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.