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
impl EmbeddedKernel
Sourcepub fn open(data_dir: &Path) -> Result<Self, PortError>
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.
Sourcepub fn open_with_engine(
data_dir: &Path,
engine: Option<StorageEngine>,
) -> Result<Self, PortError>
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.
Sourcepub fn engine(&self) -> StorageEngine
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.