Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }
Expand description

One explicitly closeable embedded-store handle.

Implementations§

Source§

impl Store

Source

pub fn self_check(&self, sample: usize, seed: u64) -> SelfCheckReport

Samples stored vectors deterministically and reports live-plan recall against a full-precision brute-force oracle.

Source

pub fn health(&self) -> Result<Health, StoreError>

Returns current store health without changing engine behaviour.

Source§

impl Store

Source

pub fn switch_epoch_alias( &self, target: EpochIdentity, ) -> Result<EpochAliasReport, EpochTransitionError>

Atomically publishes a registered epoch whose segments are retained.

Source

pub fn drop_epoch( &self, target: EpochId, ) -> Result<DropEpochReport, EpochTransitionError>

Explicitly drops every immutable segment belonging to an old epoch.

Source§

impl Store

Source

pub fn purge(&self, ids: &[DocId]) -> Result<PurgeToken, PurgeError>

Schedules a physical purge and returns before artifact rewriting begins.

Source

pub fn await_physical_purge( &self, token: PurgeToken, ) -> Result<PurgeReport, PurgeError>

Resolves only after rewritten artifacts are committed and old paths are unlinked.

Source§

impl Store

Source

pub fn drop_partition( &self, key_range: Range<i64>, ) -> Result<DropPartitionReport, StoreError>

Drops immutable segments wholly contained by the half-open timestamp range.

Source

pub fn apply_retention( &self, policy: RetentionPolicy, now_ts: i64, ) -> Result<DropPartitionReport, StoreError>

Evaluates a retention policy now and explicitly invokes partition drop.

Source§

impl Store

Source

pub fn seal(&self) -> Result<u64, StoreError>

Seals the current active segment into one appended immutable segment.

An empty active segment is an idempotent no-op that returns the current generation without publishing a manifest or segment.

Source

pub fn seal_with_cancel(&self, cancel: &CancelToken) -> Result<u64, StoreError>

Seals explicitly unless caller cancellation wins before manifest commit.

Cancellation is checked before the empty-segment no-op.

Source§

impl Store

Source

pub fn lexical_corpus_stats(&self) -> Result<CorpusStats, StoreLexicalError>

Returns exact live corpus statistics for store-backed lexical scoring.

§Errors

Returns a store admission or segment error when the current lexical corpus cannot be read, or an index error when the corpus is empty.

Source

pub fn ingest(&self, batch: IngestBatch) -> Result<IngestAck, IngestError>

Commits one active-segment upsert and returns its WAL/generation coordinates.

Source

pub fn delete(&self, batch: DeleteBatch) -> Result<IngestAck, IngestError>

Durably tombstones documents across active and sealed state before acknowledging.

Source§

impl Store

Source

pub fn close(&self) -> Result<(), StoreError>

Synchronously tears down this handle and releases writer ownership.

Concurrent callers wait for the one Open -> Closing -> Closed transition and observe the same completed close. Admitted reads may run through the configured bounded drain grace period. At that deadline their published snapshot is marked cancelled, and close waits for those cooperative reads to observe cancellation and release their Arc before it unmaps segments. Calling close after completion is successful and has no further effect.

Source§

impl Store

Source

pub fn search_hybrid_with_text_deferred<'vector, E, R>( &self, prepare_vector: impl FnOnce() -> Result<SearchRequest<'vector>, E>, lexical: &TermQuery, query: &HybridQuery, options: impl Into<SearchOptions>, control: QueryControl, finish: impl FnOnce(&StoreHybridSearchOutcome, &QueryMaterializer<'_>) -> R, ) -> Result<(StoreHybridSearchOutcome, R), HybridPreparationError<E>>

Starts lexical retrieval before obtaining a caller-owned query vector. Both legs and returned text use one admission pinned before the producer runs. All submitted lexical work is joined on producer failure or panic.

The returned vector borrow must remain valid for the complete query. Producer errors retain their original type; core failures are separate.

§Errors

Returns the producer’s error or a typed admission/search failure.

Source

pub fn search_hybrid_with_text<R>( &self, vector: SearchRequest<'_>, lexical: &TermQuery, query: &HybridQuery, options: impl Into<SearchOptions>, control: QueryControl, finish: impl FnOnce(&StoreHybridSearchOutcome, &QueryMaterializer<'_>) -> R, ) -> Result<(StoreHybridSearchOutcome, R), FusionError>

Runs hybrid fusion and constructs caller-owned results before releasing its snapshot.

Source

pub fn search_lexical_with_text<R>( &self, query: &TermQuery, k: usize, control: QueryControl, finish: impl FnOnce(&StoreLexicalSearchOutcome, &QueryMaterializer<'_>) -> R, ) -> Result<(StoreLexicalSearchOutcome, R), StoreLexicalError>

Runs a lexical query and constructs caller-owned results before releasing its snapshot.

Source

pub fn search_with_text<R>( &self, request: SearchRequest<'_>, k: usize, options: impl Into<SearchOptions>, control: QueryControl, finish: impl FnOnce(&SearchOutcome, &QueryMaterializer<'_>) -> R, ) -> Result<(SearchOutcome, R), QueryError>

Runs a dense query and constructs owned caller results through rank-addressed text access.

Source§

impl Store

Source

pub fn prepare_segment<'a>( &self, segment: InMemorySegment<'a>, ) -> Result<PreparedSegment<'a>, StoreError>

Adopts already-built vector buffers and charges their exact capacities.

No ingest, graph construction, scheduling, or background work occurs at this seam. The returned value must be consumed by Self::seal_snapshot.

Source

pub fn seal_snapshot( &self, segment: PreparedSegment<'_>, ) -> Result<u64, StoreError>

Writes, commits, read-only remaps, and publishes one complete snapshot.

The prepared anonymous vector buffers are consumed only after the new SegmentReader snapshot is live. The committed manifest contains the one complete segment supplied here; this is snapshot replacement, not task 10’s future append/ingest behavior.

Source§

impl Store

Source

pub fn stats(&self) -> Result<Stats, StoreError>

Returns exact accounting and kernel counters for this open handle.

This operation never estimates. Engine-owned counters are maintained at allocation/mapping boundaries, mapped residency comes from mincore, and phys_footprint comes from Darwin TASK_VM_INFO.

Source§

impl Store

Source

pub fn open( path: impl AsRef<Path>, options: OpenOptions, ) -> Result<Self, StoreError>

Opens a store directory with the requested access and durability policy.

Source

pub fn epoch_identity(&self) -> Option<EpochIdentity>

Returns the published embedding and tokenizer identity, or None for a store that carries no stamped epoch.

Source

pub fn state(&self) -> Result<StoreState, StoreError>

Returns the current explicit lifecycle state.

Source

pub fn snapshot(&self) -> Result<SnapshotLease, StoreError>

Acquires the complete immutable snapshot admitted for one read.

Source

pub fn top_k_with_options( &self, request: ScanRequest<'_>, k: usize, options: ScanOptions, control: QueryControl, ) -> Result<ScanOutcome, QueryError>

Runs one exact parallel scan admitted against this store’s snapshot.

The query holds one snapshot lease for its complete execution and uses the store’s lazily started persistent worker pool.

Source

pub fn search( &self, request: SearchRequest<'_>, k: usize, options: impl Into<SearchOptions>, control: QueryControl, ) -> Result<SearchOutcome, QueryError>

Searches the active segment plus every immutable segment in one pinned store generation, then merges one global top-k.

Scan-tier segments use the persistent query pool. Explicit graph-tier segments traverse serially on the calling thread, while the active segment is still scanned. Both tiers share one cancellation state and (RowSource, local_row) addressing, so immutable row zero never collides across segments and manifest reordering cannot rename a sealed row.

Source

pub fn search_lexical( &self, query: &TermQuery, k: usize, control: QueryControl, ) -> Result<StoreLexicalSearchOutcome, StoreLexicalError>

Runs an exact structured lexical query over active and sealed text.

Source

pub fn stored_text( &self, version: DocumentVersion, ) -> Result<Option<String>, StoreLexicalError>

Returns the stored UTF-8 body for one exact document revision.

Active memory and immutable region 14 are searched without adding a second text format. None means either that the exact revision is not present or that its text field was absent.

Source

pub fn search_lexical_structured( &self, query: &LexicalQuery, k: usize, snippet_bytes: usize, control: QueryControl, ) -> Result<StoreStructuredLexicalSearchOutcome, StoreLexicalError>

Runs a structured lexical query and returns provenance plus snippets copied from the exact row text pinned for this generation.

Source

pub fn search_hybrid( &self, vector_query: SearchRequest<'_>, lexical_query: &TermQuery, hybrid_query: &HybridQuery, options: impl Into<SearchOptions>, control: QueryControl, ) -> Result<StoreHybridSearchOutcome, FusionError>

Runs the store vector engine and exact lexical leg against one pinned generation, then delegates every blend decision to crate::fusion.

Source

pub fn search_hybrid_structured( &self, vector_query: SearchRequest<'_>, lexical_query: &LexicalQuery, hybrid_query: &HybridQuery, options: impl Into<SearchOptions>, control: QueryControl, ) -> Result<StoreHybridSearchOutcome, FusionError>

Runs vector work with any structured lexical operator against the same pinned snapshot and generation.

Source§

impl Store

Source

pub fn search_filtered( &self, request: SearchRequest<'_>, predicate: &Predicate, k: usize, options: impl Into<SearchOptions>, control: QueryControl, ) -> Result<FilteredSearchOutcome, FilteredSearchError>

Plans and executes one exact filtered vector query.

Predicate/schema failures are returned before active or sealed rows are scored. Published graph segments use a reported exact-scan fallback until task 19-M6 adds filter-aware traversal.

Source§

impl Store

Source

pub fn maintain(&self, budget: MaintenanceBudget) -> MaintenanceReport

Runs due tier transitions within a host-supplied work budget.

Trait Implementations§

Source§

impl Drop for Store

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl !UnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.