pub struct EchoHandler {
pub prefix: String,
pub agent_name: String,
}Expand description
A simple echo handler for testing and demos
Fields§
§prefix: String§agent_name: StringTrait Implementations§
Source§impl Default for EchoHandler
impl Default for EchoHandler
Source§impl MessageHandler for EchoHandler
impl MessageHandler for EchoHandler
Source§fn handle_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
_auth: Option<AuthContext>,
) -> Pin<Box<dyn Future<Output = HandlerResult<SendMessageResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
_auth: Option<AuthContext>,
) -> Pin<Box<dyn Future<Output = HandlerResult<SendMessageResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process an incoming A2A message and return a Task or Message
Source§fn agent_card(&self, base_url: &str) -> AgentCard
fn agent_card(&self, base_url: &str) -> AgentCard
Return the agent card for this handler
Source§fn cancel_task<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = HandlerResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel_task<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = HandlerResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Optional: Handle task cancellation
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Optional: Check if handler supports streaming
Source§fn extended_agent_card<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_base_url: &'life1 str,
_auth: &'life2 AuthContext,
) -> Pin<Box<dyn Future<Output = Option<AgentCard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn extended_agent_card<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_base_url: &'life1 str,
_auth: &'life2 AuthContext,
) -> Pin<Box<dyn Future<Output = Option<AgentCard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Optional: Return an extended agent card for authenticated requests
Auto Trait Implementations§
impl Freeze for EchoHandler
impl RefUnwindSafe for EchoHandler
impl Send for EchoHandler
impl Sync for EchoHandler
impl Unpin for EchoHandler
impl UnwindSafe for EchoHandler
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