pub struct A2aClient { /* private fields */ }Expand description
A2A client for communicating with a remote agent.
Implementations§
Source§impl A2aClient
impl A2aClient
Sourcepub fn new(url: &str, timeout: Duration) -> Self
pub fn new(url: &str, timeout: Duration) -> Self
Creates a new A2A client for the given agent URL.
Sourcepub async fn send_task(&self, task: &str) -> Result<String>
pub async fn send_task(&self, task: &str) -> Result<String>
Sends a task to the agent and returns the response text.
Uses the A2A JSON-RPC protocol:
{"jsonrpc": "2.0", "method": "tasks/send", "params": {...}, "id": 1}
§Errors
Returns an error if the HTTP request fails or the response cannot be parsed.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for A2aClient
impl !UnwindSafe for A2aClient
impl Freeze for A2aClient
impl Send for A2aClient
impl Sync for A2aClient
impl Unpin for A2aClient
impl UnsafeUnpin for A2aClient
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