pub struct Engine { /* private fields */ }Implementations§
Source§impl Engine
impl Engine
pub fn open(path: impl Into<PathBuf>) -> Result<OpenedEngine, EngineOpenError>
Sourcepub fn open_with_choice(
path: impl Into<PathBuf>,
choice: EmbedderChoice,
) -> Result<OpenedEngine, EngineOpenError>
pub fn open_with_choice( path: impl Into<PathBuf>, choice: EmbedderChoice, ) -> Result<OpenedEngine, EngineOpenError>
Open an engine with an explicit EmbedderChoice.
Per dev/design/embedder.md §0 + the 0.7.1 EU-5 campaign, this is
the canonical entry point for selecting how the workspace’s
default embedder is supplied. See EmbedderChoice for the
semantics of each variant; in particular Default materializes
the pinned BGE embedder via the loader when the default-embedder
feature is enabled.
pub fn open_with_migration_event_sink( path: impl Into<PathBuf>, emit_migration_event: impl FnMut(&MigrationStepReport), ) -> Result<OpenedEngine, EngineOpenError>
pub fn path(&self) -> &Path
pub fn write( &self, batch: &[PreparedWrite], ) -> Result<WriteReceipt, EngineError>
pub fn search(&self, query: &str) -> Result<SearchResult, EngineError>
Sourcepub fn search_filtered(
&self,
query: &str,
filter: Option<SearchFilter>,
) -> Result<SearchResult, EngineError>
pub fn search_filtered( &self, query: &str, filter: Option<SearchFilter>, ) -> Result<SearchResult, EngineError>
G10 — hybrid search with an optional closed SearchFilter. None
(or an all-None filter) is the unfiltered path whose phase-1 SQL is
byte-identical to 0.7.2. The filter prunes the vector branch in the
single phase-1 candidates statement and constrains the text branch by the
same metadata. Ranking is the unconditional G9 RRF fusion.
Sourcepub fn read_get(
&self,
logical_id: &str,
) -> Result<Option<NodeRecord>, EngineError>
pub fn read_get( &self, logical_id: &str, ) -> Result<Option<NodeRecord>, EngineError>
Slice 30 (G2) — read.get: active-only point lookup by logical_id.
Delegates to Engine::read_get_many; returns the single slot. A
missing/superseded id is None (a normal absence, not an error). Reads
ride the ReaderWorkerPool DEFERRED-tx path (never the writer lock).
Sourcepub fn read_get_many(
&self,
logical_ids: &[String],
) -> Result<Vec<Option<NodeRecord>>, EngineError>
pub fn read_get_many( &self, logical_ids: &[String], ) -> Result<Vec<Option<NodeRecord>>, EngineError>
Slice 30 (G2) — read.get_many: active-only point lookup over many
logical_ids. Returns one slot per requested id in REQUEST ORDER, None
where no active row carries that id (partial, never all-or-nothing).
Sourcepub fn read_collection(
&self,
collection: &str,
after_id: Option<i64>,
limit: usize,
) -> Result<Vec<OpStoreRow>, EngineError>
pub fn read_collection( &self, collection: &str, after_id: Option<i64>, limit: usize, ) -> Result<Vec<OpStoreRow>, EngineError>
Slice 30 (G3) — read.collection: paginated op-store read-back over
operational_mutations for collection, ORDER BY id. limit is
MANDATORY (clamped to the ~1M cap); after_id is the exclusive cursor.
Reads ride the ReaderWorkerPool DEFERRED-tx path.
Sourcepub fn read_mutations(
&self,
collection: &str,
after_id: Option<i64>,
limit: usize,
) -> Result<Vec<OpStoreRow>, EngineError>
pub fn read_mutations( &self, collection: &str, after_id: Option<i64>, limit: usize, ) -> Result<Vec<OpStoreRow>, EngineError>
Slice 30 (G3) — read.mutations: the mutation-log-oriented alias surface
over the SAME op-store read-back as Engine::read_collection.
pub fn close(&self) -> Result<(), EngineError>
Sourcepub fn drain(&self, timeout_ms: u64) -> Result<(), EngineError>
pub fn drain(&self, timeout_ms: u64) -> Result<(), EngineError>
Block until in-flight writes drain or timeout_ms elapses.
Surface owned by dev/interfaces/rust.md § Engine-attached
instrumentation; semantics are owned by dev/design/lifecycle.md.
Sourcepub fn counters(&self) -> CounterSnapshot
pub fn counters(&self) -> CounterSnapshot
Snapshot of engine-internal counters.
Field set owned by dev/design/lifecycle.md.
Sourcepub fn set_profiling(&self, enabled: bool) -> Result<(), EngineError>
pub fn set_profiling(&self, enabled: bool) -> Result<(), EngineError>
Toggle response-cycle profiling.
Per dev/design/lifecycle.md § Per-statement profiling, profiling
is an opt-in surface that is independently toggleable on a running
engine without restart. AC-005a locks runtime toggleability.
Sourcepub fn set_slow_threshold_ms(&self, value: u64) -> Result<(), EngineError>
pub fn set_slow_threshold_ms(&self, value: u64) -> Result<(), EngineError>
Set the threshold above which an operation is reported as slow.
Per dev/design/lifecycle.md § Slow and heartbeat policy, the
threshold is runtime-configurable; mutating it changes detection
behavior on subsequent statements without restart (AC-007b).
Sourcepub fn subscribe(&self, subscriber: Arc<dyn Subscriber>) -> Subscription
pub fn subscribe(&self, subscriber: Arc<dyn Subscriber>) -> Subscription
Attach a host subscriber to engine events.
Dropping the returned Subscription detaches the subscriber.
Payload shape owned by dev/design/lifecycle.md and
dev/design/migrations.md.
Sourcepub fn drain_embedder_events(&self) -> Result<Vec<EmbedderEvent>, EngineError>
pub fn drain_embedder_events(&self) -> Result<Vec<EmbedderEvent>, EngineError>
0.7.2 PR-2b — NON-test observation seam. Drains and returns every
EmbedderEvent queued since the last drain (mean pin, manual mean
recompute). Production callers use
this to observe the synchronous recompute work; events are queued
only AFTER the recompute transaction is durable, so a rolled-back
recompute never surfaces. Mirrors the at-open
OpenReport.embedder_events channel for the steady-state path.