pub struct KernelClient { /* private fields */ }Expand description
A connected kernel-management client. One short-lived
KernelClient per HTTP request; the per-request connection (plus
the per-call UUID embedded in the topic) avoids cross-talk
between concurrent dashboard calls.
Implementations§
Source§impl KernelClient
impl KernelClient
Sourcepub async fn connect(caller: PrincipalId) -> Result<Self>
pub async fn connect(caller: PrincipalId) -> Result<Self>
Connect to the running daemon, authenticate via the existing
handshake, and bind the client to caller. Every outbound
request stamps IpcMessage.principal = caller so the kernel’s
resolve_caller reads it for Layer 5 capability checks.
§Errors
Returns an error if the socket file is missing (no daemon), connection fails, or the handshake is rejected.
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Override the response read timeout.
Sourcepub async fn request(&mut self, req: KernelRequest) -> Result<KernelResponse>
pub async fn request(&mut self, req: KernelRequest) -> Result<KernelResponse>
Send a KernelRequest and await the matching
KernelResponse.
§Errors
Returns an error on serialization failure, send failure, or timeout / connection drop before a matching response arrives.
Sourcepub const fn caller(&self) -> &PrincipalId
pub const fn caller(&self) -> &PrincipalId
Borrow the principal this client stamps on outbound messages.