A condensed overview of all public types, traits, and functions across the a2a-rust crates.
| Type | Description |
Task | Unit of work with ID, status, history, artifacts |
TaskId | Newtype wrapper for task identifiers |
TaskState | Enum: Submitted, Working, InputRequired, AuthRequired, Completed, Failed, Canceled, Rejected |
TaskStatus | State + optional message + timestamp |
TaskVersion | Monotonically increasing version number |
ContextId | Conversation context identifier |
| Type | Description |
Message | Structured payload with ID, role, parts |
MessageId | Newtype wrapper for message identifiers |
MessageRole | Enum: User, Agent |
Part | Content unit: text, file, or data |
PartContent | Enum: Text, File, Data |
| Type | Description |
Artifact | Result produced by an agent |
ArtifactId | Newtype wrapper for artifact identifiers |
| Type | Description |
StreamResponse | Enum: Task, Message, StatusUpdate, ArtifactUpdate |
TaskStatusUpdateEvent | Status change notification |
TaskArtifactUpdateEvent | Artifact delivery notification |
| Type | Description |
AgentCard | Root discovery document |
AgentInterface | Transport endpoint descriptor |
AgentCapabilities | Capability flags (streaming, push, extended card) |
AgentSkill | Discrete agent capability |
AgentProvider | Organization info |
| Type | Description |
MessageSendParams | SendMessage / SendStreamingMessage input |
SendMessageConfiguration | Output modes, history, push config |
TaskQueryParams | GetTask input |
ListTasksParams | ListTasks input with filters and pagination |
CancelTaskParams | CancelTask input |
TaskIdParams | SubscribeToTask input |
| Type | Description |
TaskPushNotificationConfig | Webhook registration |
AuthenticationInfo | Webhook auth credentials |
| Type | Description |
SendMessageResponse | Enum: Task or Message |
TaskListResponse | Paginated task list |
| Type | Description |
A2aError | Protocol-level error |
ErrorCode | Standard error codes |
A2aResult<T> | Alias for Result<T, A2aError> |
| Type | Description |
JsonRpcRequest | JSON-RPC 2.0 request envelope |
JsonRpcError | JSON-RPC error object |
JsonRpcVersion | Version marker ("2.0") |
| Type | Description |
A2aClient | Main client for calling remote agents |
ClientBuilder | Fluent builder for client configuration |
EventStream | Async SSE event stream |
RetryPolicy | Configurable retry with exponential backoff |
| Method | Returns | Description |
send_message(params) | SendMessageResponse | Synchronous send |
stream_message(params) | EventStream | Streaming send |
get_task(params) | Task | Retrieve task by ID |
list_tasks(params) | TaskListResponse | Query tasks |
cancel_task(id) | Task | Cancel a running task |
subscribe_to_task(id) | EventStream | Re-subscribe to task events |
set_push_config(config) | TaskPushNotificationConfig | Create push config |
get_push_config(task_id, id) | TaskPushNotificationConfig | Get push config |
list_push_configs(params) | ListPushConfigsResponse | List push configs |
delete_push_config(task_id, id) | () | Delete push config |
get_authenticated_extended_card(params) | AgentCard | Get extended card |
| Type | Description |
CallInterceptor | Request/response hook trait |
InterceptorChain | Ordered interceptor sequence |
| Type | Description |
Transport | Pluggable transport trait |
JsonRpcTransport | JSON-RPC 2.0 transport |
RestTransport | REST/HTTP transport |
| Type | Description |
RequestHandler | Central protocol orchestrator |
RequestHandlerBuilder | Fluent builder for handler configuration |
RequestContext | Information about the incoming request |
| Trait | Description |
AgentExecutor | Agent logic entry point |
TaskStore | Task persistence backend |
PushConfigStore | Push config persistence |
PushSender | Webhook delivery |
ServerInterceptor | Server-side middleware |
AgentCardProducer | Dynamic agent card generation |
Dispatcher | HTTP dispatch trait (for serve()) |
| Type | Description |
JsonRpcDispatcher | JSON-RPC 2.0 HTTP dispatcher (implements Dispatcher) |
RestDispatcher | RESTful HTTP dispatcher (implements Dispatcher) |
| Function | Description |
serve(addr, dispatcher) | Bind + accept loop (blocking) |
serve_with_addr(addr, dispatcher) | Bind + spawn, returns SocketAddr |
| Type | Description |
InMemoryTaskStore | In-memory task store with TTL |
InMemoryPushConfigStore | In-memory push config store |
HttpPushSender | HTTP webhook delivery with SSRF protection |
StaticAgentCardHandler | Static agent card with HTTP caching |
DynamicAgentCardHandler | Dynamic agent card with producer |
| Type | Description |
EventEmitter | Ergonomic event emission helper |
EventQueueWriter | Write events to a stream |
EventQueueReader | Read events from a stream |
EventQueueManager | Manages stream lifecycle |
InMemoryQueueWriter | Bounded channel writer |
InMemoryQueueReader | Bounded channel reader |
| Type | Description |
CorsConfig | Cross-origin policy |
TaskStoreConfig | TTL and capacity for in-memory store |
ServerError | Server-level error type |
ServerResult<T> | Alias for Result<T, ServerError> |
| Module | Re-exports |
a2a_protocol_sdk::types | All a2a-protocol-types exports |
a2a_protocol_sdk::client | All a2a-protocol-client exports |
a2a_protocol_sdk::server | All a2a-protocol-server exports |
a2a_protocol_sdk::prelude | Most commonly used types |
The prelude includes the most commonly used types from all three crates — see Project Structure for the full list.
#![allow(unused)]
fn main() {
// Task status
TaskStatus::new(TaskState::Working)
TaskStatus::with_timestamp(TaskState::Completed)
// Messages and parts
Part::text("hello")
Part::file_bytes(base64_string)
Part::file_uri("https://...")
Part::data(json_value)
// Artifacts
Artifact::new("artifact-id", vec![Part::text("content")])
// IDs
TaskId::new("task-123")
ContextId::new("ctx-456")
MessageId::new("msg-789")
// Capabilities (non_exhaustive — use builder)
AgentCapabilities::none()
.with_streaming(true)
.with_push_notifications(false)
// Push configs
TaskPushNotificationConfig::new("task-id", "https://webhook.url")
}