Expand description
Transport abstraction for A2A client requests.
The Transport trait decouples protocol logic from HTTP mechanics.
A2aClient holds a Box<dyn Transport> and calls
Transport::send_request for non-streaming methods and
Transport::send_streaming_request for SSE-streaming methods.
Four implementations ship with this crate (two behind feature flags):
| Type | Protocol | When to use |
|---|---|---|
JsonRpcTransport | JSON-RPC 2.0 over HTTP POST | Default; most widely supported |
RestTransport | HTTP REST (verbs + paths) | When the agent card requires it |
GrpcTransport | Canonical lf.a2a.v1.A2AService (protobuf) | grpc feature; service-mesh / cross-language gRPC peers |
WebSocketTransport | JSON-RPC 2.0 over a persistent WebSocket | websocket feature; long-lived low-latency connections |
Modules§
- grpc
grpc - gRPC transport implementation for the A2A client.
- jsonrpc
- JSON-RPC 2.0 over HTTP transport implementation.
- rest
- HTTP REST transport implementation.
- websocket
websocket - WebSocket transport implementation for A2A clients.
Structs§
- Grpc
Transport - gRPC transport for A2A clients.
- Json
RpcTransport - JSON-RPC 2.0 transport: HTTP POST to a single endpoint.
- Rest
Transport - REST transport: HTTP verbs mapped to REST paths.
- WebSocket
Transport - WebSocket transport: JSON-RPC 2.0 over a persistent WebSocket connection.
- WebSocket
Transport Config - Configuration for
WebSocketTransport::connect_with_config.
Constants§
- DEFAULT_
SEND_ TIMEOUT - How long a blocking
SendMessagewaits for the agent’s turn to end, by default: ten minutes.
Traits§
- Transport
- The low-level HTTP transport interface.