DWBaseEngine

Struct DWBaseEngine 

Source
pub struct DWBaseEngine<S, V, T, G, E> {
    pub storage: S,
    pub vector: V,
    pub stream: T,
    pub gatekeeper: G,
    pub embedder: E,
    pub reflex_index: ReflexIndex,
    /* private fields */
}
Expand description

Orchestrator tying together engine components.

Fields§

§storage: S§vector: V§stream: T§gatekeeper: G§embedder: E§reflex_index: ReflexIndex

Implementations§

Source§

impl<S, V, T, G, E> DWBaseEngine<S, V, T, G, E>

Source

pub fn new(storage: S, vector: V, stream: T, gatekeeper: G, embedder: E) -> Self

Source

pub fn with_reflex_index( storage: S, vector: V, stream: T, gatekeeper: G, embedder: E, reflex_index: ReflexIndex, ) -> Self

Source§

impl<S, V, T, G, E> DWBaseEngine<S, V, T, G, E>

Source

pub fn world_archived(&self, world: &WorldKey) -> Result<bool>

Source

pub fn worlds(&self) -> Result<Vec<WorldKey>>

List known worlds, excluding archived ones by default.

Source

pub fn worlds_filtered(&self, include_archived: bool) -> Result<Vec<WorldKey>>

List known worlds with optional archived inclusion.

Source

pub fn index_status(&self) -> Vec<IndexMetadata>

Source

pub async fn remember(&self, new_atom: NewAtom) -> Result<AtomId>

Remember (persist) a new atom submitted by a worker.

Source

pub async fn ask(&self, question: Question) -> Result<Answer>

Answer a question based on stored atoms.

Source

pub fn list_ids_in_window( &self, world: &WorldKey, window: &TimeWindow, ) -> Result<Vec<AtomId>>

Return atom ids for a world within a time window.

Source

pub fn storage_ready(&self) -> bool

Shallow readiness probe: returns true if storage is reachable.

Source

pub fn max_index_rebuild_lag_ms(&self) -> Option<u64>

Maximum rebuild lag (ms) across worlds that are rebuilding or not ready.

Source

pub fn get_atoms(&self, ids: &[AtomId]) -> Result<Vec<Atom>>

Fetch atoms by id using the underlying storage engine.

Source

pub async fn ingest_remote_atoms(&self, atoms: Vec<Atom>) -> Result<Vec<AtomId>>

Ingest atoms received from peers; idempotent (skips existing ids).

Source

pub fn gc_once(&self, _max_disk_mb: Option<u64>) -> Result<usize>

Run garbage collection once for all worlds. Returns number of atoms evicted.

Source

pub async fn observe(&self, atom: Atom) -> Result<()>

Observe (ingest) an atom and publish it to streams.

Source

pub async fn replay( &self, world: WorldKey, filter: AtomFilter, ) -> Result<Vec<Atom>>

Replay atoms for a world using a filter.

Source

pub async fn manage_world(&self, action: WorldAction) -> Result<()>

Perform a world-level action (create/archive/resume).

Auto Trait Implementations§

§

impl<S, V, T, G, E> !Freeze for DWBaseEngine<S, V, T, G, E>

§

impl<S, V, T, G, E> !RefUnwindSafe for DWBaseEngine<S, V, T, G, E>

§

impl<S, V, T, G, E> Send for DWBaseEngine<S, V, T, G, E>
where S: Send, V: Send, T: Send, G: Send, E: Send,

§

impl<S, V, T, G, E> Sync for DWBaseEngine<S, V, T, G, E>
where S: Sync, V: Sync, T: Sync, G: Sync, E: Sync,

§

impl<S, V, T, G, E> Unpin for DWBaseEngine<S, V, T, G, E>
where S: Unpin, V: Unpin, T: Unpin, G: Unpin, E: Unpin,

§

impl<S, V, T, G, E> UnwindSafe for DWBaseEngine<S, V, T, G, E>

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 = 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.