Skip to main content

EngineRuntime

Struct EngineRuntime 

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

Core engine runtime.

§Drop order invariant

Fields are ordered so that coordinator (reader connections) drops before writer (writer thread + connection). This ensures the writer’s sqlite3_close() is the last connection to the database, which triggers SQLite’s automatic passive WAL checkpoint and WAL/shm file cleanup. _vector_actor drops after writer and before _rebuild so the vector projection thread stops submitting writer messages before the writer channel closes (actually the writer drops first because we hold the writer in an Arc shared with the admin service, and the Arc survives through admin; effectively the admin handle drops before the vector actor’s join). _rebuild drops before _lock so the rebuild thread’s connection closes before the exclusive file lock is released. _lock drops last so the exclusive file lock is released only after all connections are closed. Do not reorder these fields.

telemetry holds shared counters and has no drop-order concern (atomics).

Implementations§

Source§

impl EngineRuntime

Source

pub fn open( path: impl AsRef<Path>, provenance_mode: ProvenanceMode, vector_dimension: Option<usize>, read_pool_size: usize, telemetry_level: TelemetryLevel, query_embedder: Option<Arc<dyn QueryEmbedder>>, ) -> Result<Self, EngineError>

§Errors

Returns EngineError if the database connection cannot be opened, schema bootstrap fails, or the writer actor cannot be started.

Source

pub fn coordinator(&self) -> &ExecutionCoordinator

Source

pub fn writer(&self) -> &WriterActor

Source

pub fn writer_arc(&self) -> Arc<WriterActor>

Cloneable shared handle to the writer actor.

Source

pub fn admin(&self) -> &AdminHandle

Source

pub fn telemetry(&self) -> &Arc<TelemetryCounters>

Shared telemetry counters for incrementing from the public API layer.

Source

pub fn telemetry_snapshot(&self) -> TelemetrySnapshot

Read all telemetry counters and aggregate SQLite cache status across the reader pool.

Trait Implementations§

Source§

impl Debug for EngineRuntime

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V