pub struct A2AClient { /* private fields */ }Expand description
A2A Client - communicates with remote A2A agents.
Implementations§
Source§impl A2AClient
impl A2AClient
Sourcepub fn with_http_client(base_url: String, http: Client) -> Self
pub fn with_http_client(base_url: String, http: Client) -> Self
Create a client with a custom reqwest::Client (for timeouts, etc.).
Sourcepub async fn get_agent_card(&self) -> Result<AgentCard, A2AError>
pub async fn get_agent_card(&self) -> Result<AgentCard, A2AError>
Fetch the agent card from GET /.well-known/agent.json.
Sourcepub async fn send_task(&self, message: A2AMessage) -> Result<A2ATask, A2AError>
pub async fn send_task(&self, message: A2AMessage) -> Result<A2ATask, A2AError>
Send a task to the remote agent (tasks/send).
Sourcepub async fn get_task(&self, task_id: &str) -> Result<A2ATask, A2AError>
pub async fn get_task(&self, task_id: &str) -> Result<A2ATask, A2AError>
Get a task by ID (tasks/get).
Sourcepub async fn cancel_task(&self, task_id: &str) -> Result<A2ATask, A2AError>
pub async fn cancel_task(&self, task_id: &str) -> Result<A2ATask, A2AError>
Cancel a task by ID (tasks/cancel).
Sourcepub async fn post_request(
&self,
req: A2ARequest,
) -> Result<A2AResponse, A2AError>
pub async fn post_request( &self, req: A2ARequest, ) -> Result<A2AResponse, A2AError>
Send a raw A2A request via POST to the agent endpoint.
Auto Trait Implementations§
impl !Freeze for A2AClient
impl !RefUnwindSafe for A2AClient
impl !UnwindSafe 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