pub struct KernelMessageHandler { /* private fields */ }Expand description
Handler implementation that wires the call executor into the MXP handler trait.
Implementations§
Source§impl KernelMessageHandler
impl KernelMessageHandler
Sourcepub fn new(
adapter: Arc<dyn ModelAdapter>,
tools: Arc<ToolRegistry>,
sink: Arc<dyn CallOutcomeSink>,
) -> Self
pub fn new( adapter: Arc<dyn ModelAdapter>, tools: Arc<ToolRegistry>, sink: Arc<dyn CallOutcomeSink>, ) -> Self
Creates a new handler using the provided adapter and registry.
Sourcepub fn builder(
adapter: Arc<dyn ModelAdapter>,
sink: Arc<dyn CallOutcomeSink>,
) -> KernelMessageHandlerBuilder
pub fn builder( adapter: Arc<dyn ModelAdapter>, sink: Arc<dyn CallOutcomeSink>, ) -> KernelMessageHandlerBuilder
Creates a builder that automates tool registration and optional components.
Sourcepub fn with_memory(self, memory: Arc<MemoryBus>) -> Self
pub fn with_memory(self, memory: Arc<MemoryBus>) -> Self
Configures the memory bus used to persist call transcripts.
Sourcepub fn set_memory(&mut self, memory: Arc<MemoryBus>)
pub fn set_memory(&mut self, memory: Arc<MemoryBus>)
Installs or replaces the memory bus after construction.
Sourcepub fn with_policy(self, policy: Arc<dyn PolicyEngine>) -> Self
pub fn with_policy(self, policy: Arc<dyn PolicyEngine>) -> Self
Configures the policy engine used to guard tool execution and model inference.
Sourcepub fn set_policy(&mut self, policy: Arc<dyn PolicyEngine>)
pub fn set_policy(&mut self, policy: Arc<dyn PolicyEngine>)
Installs or replaces the policy engine after construction.
Sourcepub fn with_policy_observer(self, observer: Arc<dyn PolicyObserver>) -> Self
pub fn with_policy_observer(self, observer: Arc<dyn PolicyObserver>) -> Self
Configures the policy observer used to record governance decisions.
Sourcepub fn set_policy_observer(&mut self, observer: Arc<dyn PolicyObserver>)
pub fn set_policy_observer(&mut self, observer: Arc<dyn PolicyObserver>)
Installs or replaces the policy observer after construction.
Sourcepub fn policy_observer(&self) -> Option<&Arc<dyn PolicyObserver>>
pub fn policy_observer(&self) -> Option<&Arc<dyn PolicyObserver>>
Returns the configured policy observer, if any.
Sourcepub fn executor(&self) -> &CallExecutor
pub fn executor(&self) -> &CallExecutor
Returns the underlying executor for advanced scenarios.
Trait Implementations§
Source§impl AgentMessageHandler for KernelMessageHandler
impl AgentMessageHandler for KernelMessageHandler
Source§fn handle_call<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_call<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
Call messages.Source§fn handle_agent_register<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_agent_register<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
AgentRegister messages.Source§fn handle_agent_discover<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_agent_discover<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
AgentDiscover messages.Source§fn handle_agent_heartbeat<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_agent_heartbeat<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
AgentHeartbeat messages.Source§fn handle_response<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_response<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
Response messages.Source§fn handle_event<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_event<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
Event messages.Source§fn handle_stream_open<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_stream_open<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
StreamOpen messages.Source§fn handle_stream_chunk<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_stream_chunk<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
StreamChunk messages.Source§fn handle_stream_close<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_stream_close<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
StreamClose messages.Source§fn handle_ack<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_ack<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for
Ack messages.Source§fn handle_error<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_error<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called for protocol-level error responses.
Source§fn handle_unhandled<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
message_type: MessageType,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_unhandled<'life0, 'async_trait>(
&'life0 self,
ctx: HandlerContext,
message_type: MessageType,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fallback invoked when a specialized handler is not implemented.
Auto Trait Implementations§
impl Freeze for KernelMessageHandler
impl !RefUnwindSafe for KernelMessageHandler
impl Send for KernelMessageHandler
impl Sync for KernelMessageHandler
impl Unpin for KernelMessageHandler
impl !UnwindSafe for KernelMessageHandler
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