pub struct KernelServiceApi { /* private fields */ }Expand description
Concrete ServiceApi implementation backed by a ServiceRegistry.
Routes call() requests to the registered SystemService by name,
maps list_services() to the registry snapshot, and delegates
health() to each service’s health check.
This is the production implementation that protocol adapters
(Shell, MCP, HTTP) hold via Arc<dyn ServiceApi>.
Implementations§
Source§impl KernelServiceApi
impl KernelServiceApi
Sourcepub fn new(registry: Arc<ServiceRegistry>) -> Self
pub fn new(registry: Arc<ServiceRegistry>) -> Self
Create a new kernel service API backed by the given registry.
Sourcepub fn registry(&self) -> &ServiceRegistry
pub fn registry(&self) -> &ServiceRegistry
Get a reference to the underlying registry.
Trait Implementations§
Source§impl ServiceApi for KernelServiceApi
impl ServiceApi for KernelServiceApi
Source§fn call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
service: &'life1 str,
method: &'life2 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
service: &'life1 str,
method: &'life2 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Call a method on a named service.
Source§fn list_services<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ServiceInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_services<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ServiceInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available services.
Auto Trait Implementations§
impl !RefUnwindSafe for KernelServiceApi
impl !UnwindSafe for KernelServiceApi
impl Freeze for KernelServiceApi
impl Send for KernelServiceApi
impl Sync for KernelServiceApi
impl Unpin for KernelServiceApi
impl UnsafeUnpin for KernelServiceApi
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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