pub struct Kernel { /* private fields */ }Expand description
The Oxide micro-kernel.
Owns the MessageBus, ModuleManager and StateRegistry and exposes
them as cheap-to-clone handles. Cloning the kernel itself is also cheap and
produces a handle pointing at the same underlying state.
Implementations§
Source§impl Kernel
impl Kernel
Sourcepub async fn in_memory() -> Result<Self>
pub async fn in_memory() -> Result<Self>
Build a kernel backed by an in-memory state registry. Intended for development, testing, and the bootstrap CLI.
Sourcepub async fn with_registry(path: &str) -> Result<Self>
pub async fn with_registry(path: &str) -> Result<Self>
Build a kernel backed by an on-disk state registry at path.
Sourcepub fn bus(&self) -> &MessageBus
pub fn bus(&self) -> &MessageBus
Handle to the message bus.
Sourcepub fn modules(&self) -> &ModuleManager
pub fn modules(&self) -> &ModuleManager
Handle to the module manager.
Sourcepub fn registry(&self) -> &StateRegistry
pub fn registry(&self) -> &StateRegistry
Handle to the global state registry.
Source§impl Kernel
impl Kernel
Sourcepub async fn register_module_from_manifest(
&self,
path: &Path,
) -> Result<ResolvedManifest>
pub async fn register_module_from_manifest( &self, path: &Path, ) -> Result<ResolvedManifest>
Register a module described by a module.json manifest with the
kernel’s state registry.
path may be the manifest file or its parent directory. The module is
recorded in ModuleState::Loaded. Starting the underlying binary is
the responsibility of a future process supervisor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Kernel
impl !RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnsafeUnpin for Kernel
impl !UnwindSafe for Kernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more