pub struct A2aClient { /* private fields */ }Implementations§
Source§impl A2aClient
impl A2aClient
pub fn new(client: Client) -> Self
pub fn with_security(self, require_tls: bool, ssrf_protection: bool) -> Self
Sourcepub async fn send_message(
&self,
endpoint: &str,
params: SendMessageParams,
token: Option<&str>,
) -> Result<Task, A2aError>
pub async fn send_message( &self, endpoint: &str, params: SendMessageParams, token: Option<&str>, ) -> Result<Task, A2aError>
§Errors
Returns A2aError on network, JSON, or JSON-RPC errors.
Sourcepub async fn stream_message(
&self,
endpoint: &str,
params: SendMessageParams,
token: Option<&str>,
) -> Result<TaskEventStream, A2aError>
pub async fn stream_message( &self, endpoint: &str, params: SendMessageParams, token: Option<&str>, ) -> Result<TaskEventStream, A2aError>
§Errors
Returns A2aError on network failure or if the SSE connection cannot be established.
Sourcepub async fn get_task(
&self,
endpoint: &str,
params: TaskIdParams,
token: Option<&str>,
) -> Result<Task, A2aError>
pub async fn get_task( &self, endpoint: &str, params: TaskIdParams, token: Option<&str>, ) -> Result<Task, A2aError>
§Errors
Returns A2aError on network, JSON, or JSON-RPC errors.
Sourcepub async fn cancel_task(
&self,
endpoint: &str,
params: TaskIdParams,
token: Option<&str>,
) -> Result<Task, A2aError>
pub async fn cancel_task( &self, endpoint: &str, params: TaskIdParams, token: Option<&str>, ) -> Result<Task, A2aError>
§Errors
Returns A2aError on network, JSON, or JSON-RPC errors.
Auto Trait Implementations§
impl Freeze for A2aClient
impl !RefUnwindSafe for A2aClient
impl Send for A2aClient
impl Sync for A2aClient
impl Unpin for A2aClient
impl UnsafeUnpin for A2aClient
impl !UnwindSafe 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