Skip to main content

Module client

Module client 

Source
Expand description

HTTP client for sending A2A requests.

Modules§

auth
Authentication interceptor and credential storage.
balance
Calls spread over several endpoints of one agent, with failing ones ejected and idempotent calls optionally hedged (ADR 0050, audit H12).
builder
Fluent builder for A2aClient.
client
Core A2aClient struct and constructors.
config
Client configuration types.
delegation
A task delegated to another agent, cancelled with its parent.
discovery
Agent card discovery with HTTP caching.
error
Client error types.
interceptor
Request/response interceptor infrastructure.
jwkssigning
Fetching a JWK Set to verify an agent card’s signatures with (signing feature).
methods
Per-method client helpers.
otel_baggage
W3C Baggage on outbound calls, and OTEL_PROPAGATORS (audit C-10; ADR 0038 §1).
retry
Configurable retry policy for transient client errors.
streaming
SSE client-side streaming support.
testingtesting
Scripted hostile peers, for testing whatever calls an agent.
tlstls-rustls
TLS connector via rustls, and the HTTP client every HTTP call shares.
token_provider
Token acquisition: TokenProvider, OAuth 2.0 client-credentials, and OIDC discovery.
trace_propagation
Propagating W3C trace context on outbound calls.
transport
Transport abstraction for A2A client requests.
version_query
Sends the protocol version as a request parameter as well as a header.
webhookwebhook
The receiving side of push notifications (spec §4.3.3, §13.2).

Structs§

A2aClient
A client for communicating with A2A-compliant agents.
AuthInterceptor
A CallInterceptor that injects Authorization headers from a CredentialsStore.
BearerAuthInterceptor
A CallInterceptor that injects Authorization: Bearer <token> from a TokenProvider before every request.
ClientBuilder
Builder for A2aClient.
ClientConfig
Configuration for an crate::A2aClient instance.
ClientRequest
A logical A2A request as seen by interceptors.
ClientResponse
A logical A2A response as seen by interceptors.
CurrentTrace
The trace the current task is running under.
EventStream
An async stream of StreamResponse events from an SSE endpoint.
GrpcTransportgrpc
gRPC transport for A2A clients.
HttpPooltls-rustls
One set of HTTP connections that many clients share.
HttpPoolBuildertls-rustls
Builds an HttpPool: HttpPool::builder.
InMemoryCredentialsStore
An in-memory CredentialsStore backed by an RwLock<HashMap>.
InterceptorChain
An ordered list of CallInterceptors applied to every request.
JsonRpcTransport
JSON-RPC 2.0 transport: HTTP POST to a single endpoint.
OAuth2ClientCredentials
A TokenProvider implementing the OAuth 2.0 client credentials grant (RFC 6749 §4.4) with caching and proactive refresh.
OriginSnapshot
The state of one origin at one moment, from HttpPool::origins.
Propagators
Which propagators OTEL_PROPAGATORS turns on for the A2A wire.
RestTransport
REST transport: HTTP verbs mapped to REST paths.
RetryBudget
How many retries a client may make, as a fraction of the calls it makes.
RetryPolicy
Configuration for automatic retry with exponential backoff.
SessionId
Opaque identifier for a client authentication session.
StaticTokenProvider
A TokenProvider that always returns the same fixed token.
TracePropagationInterceptor
Writes the ambient CurrentTrace onto each outbound request.
WebSocketTransportwebsocket
WebSocket transport: JSON-RPC 2.0 over a persistent WebSocket connection.
WebSocketTransportConfigwebsocket
Configuration for WebSocketTransport::connect_with_config.
WebhookReceiverwebhook
Checks webhook requests against the push configs a client registered (spec §4.3.3, §13.2).

Enums§

BaggagePolicy
Which baggage entries cross the A2A wire.
ClientError
Errors that can occur during A2A client operations.
CredentialPreflight
What a client built from an agent card does with a call whose credentials satisfy none of the card’s security requirements (spec §3.1.11). Set with ClientBuilder::with_credential_preflight.
GrpcBareAddressScheme
How a gRPC interface address that carries no scheme is connected.
WebhookOutcomewebhook
What became of one webhook request.
WebhookRejectionwebhook
Why a webhook request was refused.

Traits§

CallInterceptor
Hooks called before every A2A request and after every response.
CredentialsStore
Persistent storage for auth credentials, keyed by session + scheme.
TokenProvider
A source of bearer access tokens.
Transport
The low-level HTTP transport interface.

Functions§

new_message_id
A new message id: a random UUID (version 4), as a MessageId.
resolve_agent_card
Fetches the AgentCard from the standard well-known path.

Type Aliases§

ClientResult
Convenience type alias: Result<T, ClientError>.