pub struct ResponderMessageHandler { /* private fields */ }Expand description
A message handler that owns task-lifecycle plumbing and streaming
announcements, delegating the reply to an injected Responder.
Holds its ports as Arc<dyn …> trait objects (injected at the composition
edge), so the handler carries no generic parameter. Because it holds both the
lifecycle and streaming ports it is a host for the TaskStatusBroadcast
capability mixin.
Implementations§
Source§impl ResponderMessageHandler
impl ResponderMessageHandler
Sourcepub fn new(
task_lifecycle: impl AsyncTaskLifecycle + 'static,
streaming: impl AsyncStreamingHandler + 'static,
push_notifier: impl AsyncPushNotifier + 'static,
responder: impl Responder + 'static,
) -> Self
pub fn new( task_lifecycle: impl AsyncTaskLifecycle + 'static, streaming: impl AsyncStreamingHandler + 'static, push_notifier: impl AsyncPushNotifier + 'static, responder: impl Responder + 'static, ) -> Self
Create a handler with a custom Responder.
The lifecycle, streaming, and push-notifier ports are accepted separately
so the handler depends only on the capabilities it uses; at the
composition edge the streaming and push ports typically come from a
dedicated streaming adapter and the store’s push_notifier().
Sourcepub fn echo(
task_lifecycle: impl AsyncTaskLifecycle + 'static,
streaming: impl AsyncStreamingHandler + 'static,
push_notifier: impl AsyncPushNotifier + 'static,
) -> Self
pub fn echo( task_lifecycle: impl AsyncTaskLifecycle + 'static, streaming: impl AsyncStreamingHandler + 'static, push_notifier: impl AsyncPushNotifier + 'static, ) -> Self
Create the reference echo handler (EchoResponder).
Trait Implementations§
Source§impl AsyncMessageHandler for ResponderMessageHandler
impl AsyncMessageHandler for ResponderMessageHandler
Source§fn process_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
message: &'life2 Message,
session_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn process_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
message: &'life2 Message,
session_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Process a message for a specific task
Source§fn validate_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 Message,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 Message,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate a message before processing
Source§fn transform_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<Message, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<Message, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transform a message before processing (e.g., for content filtering)
Source§fn handle_message_flow<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
message: Message,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_message_flow<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
message: Message,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle message processing with validation and transformation
Source§impl Clone for ResponderMessageHandler
impl Clone for ResponderMessageHandler
Source§fn clone(&self) -> ResponderMessageHandler
fn clone(&self) -> ResponderMessageHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl HasPushNotifier for ResponderMessageHandler
impl HasPushNotifier for ResponderMessageHandler
fn push_notifier(&self) -> &dyn AsyncPushNotifier
Source§impl HasStreaming for ResponderMessageHandler
impl HasStreaming for ResponderMessageHandler
fn streaming(&self) -> &dyn AsyncStreamingHandler
Source§impl HasTaskLifecycle for ResponderMessageHandler
impl HasTaskLifecycle for ResponderMessageHandler
fn lifecycle(&self) -> &dyn AsyncTaskLifecycle
Auto Trait Implementations§
impl !RefUnwindSafe for ResponderMessageHandler
impl !UnwindSafe for ResponderMessageHandler
impl Freeze for ResponderMessageHandler
impl Send for ResponderMessageHandler
impl Sync for ResponderMessageHandler
impl Unpin for ResponderMessageHandler
impl UnsafeUnpin for ResponderMessageHandler
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> 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>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> TaskStatusBroadcast for T
impl<T> TaskStatusBroadcast for T
Source§fn update_and_broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
state: TaskState,
message: Option<Message>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_and_broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
state: TaskState,
message: Option<Message>,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a task’s status, then broadcast the new status to subscribers. Read more
Source§fn cancel_and_broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel_and_broadcast<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Task, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Cancel a task through the lifecycle port, then broadcast the resulting
(terminal) status to subscribers. Read more
Source§fn broadcast_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
event: TaskArtifactUpdateEvent,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast_artifact<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
event: TaskArtifactUpdateEvent,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcast an artifact update: fan it out to streaming subscribers, then
deliver it to the task’s push endpoint (best-effort). Read more