Skip to main content

EmbeddedKernel

Struct EmbeddedKernel 

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

One opened embedded kernel: the composed service plus the store handle for operational tooling (replay, stats, compaction).

Implementations§

Source§

impl EmbeddedKernel

Source

pub fn open(data_dir: &Path) -> Result<Self, PortError>

Opens the store at data_dir (fail-fast per ADR-012) and composes the kernel. An existing directory opens with the engine it was created with; a fresh one gets the caller’s resolved default. On redb a second session on the same data dir fails here with an explicit single-writer error (ADR-011; the engine holds the lock); on SQLite it does not.

Source

pub fn open_with_engine( data_dir: &Path, engine: Option<StorageEngine>, ) -> Result<Self, PortError>

open with a say in the engine (ADR-018): a fresh directory is created for engine; an existing one must already be engine, and the mismatch is refused by name rather than quietly opened as whatever it is — that is how a user ends up on the wrong engine without knowing. None means no preference.

Source

pub fn engine(&self) -> StorageEngine

The engine behind this kernel’s store, as its data directory records it. Surfaced at startup and by the doctor so a user can see which one they are on.

Source

pub fn data_dir(&self) -> &Path

Source

pub fn store(&self) -> &EmbeddedKernelStore

Source

pub fn service(&self) -> Arc<EmbeddedMemoryService>

Source

pub fn quality_observer(&self) -> Arc<dyn QualityMetricsObserver>

Source

pub fn quality_telemetry_dropped_observations(&self) -> u64

Source

pub fn quality_telemetry_write_failures(&self) -> u64

Source

pub fn quality_telemetry_error(&self) -> Option<&str>

Source

pub fn quality_telemetry_active(&self) -> bool

Trait Implementations§

Source§

impl MemoryRecallApi for EmbeddedKernel

Source§

fn capabilities(&self) -> ApiCapabilities

What this implementation is and what it can do. Checked by consumers at startup, before anything is at stake.
Source§

async fn wake( &self, request: MemoryWakeRequest, ) -> Result<MemoryRecallView, ApiError>

Recall the bounded context of one about.
Source§

async fn ask( &self, request: MemoryAskRequest, ) -> Result<MemoryRecallView, ApiError>

Ask one question of the memory, under an explicit answer policy.
Source§

impl MemoryRecordApi for EmbeddedKernel

Source§

fn capabilities(&self) -> ApiCapabilities

What this implementation is and what it can do. The report is the same one the recall side gives — one implementation, one account of itself.
Source§

async fn record( &self, request: MemoryRecordRequest, ) -> Result<RecordedMemoryView, ApiError>

Put something into the memory of one about, idempotently. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more