A condensed overview of the public types, traits, and functions across the
a2a-rust crates.
This page is a curated selection , kept short enough to scan. For the
exhaustive, always-current listing — every item, every signature, generated
from the code on each deploy — see the generated API documentation .
Every name below is checked against the crates by
scripts/check_api_reference.py in CI, so a type that gets renamed cannot leave
a stale entry here. The same script checks the other direction at the crate
roots: every item a crate re-exports from its lib.rs — the names you reach as
use a2a_protocol_types::X — must have a row on this page. Deeper module items
are rustdoc's job.
Module Contents
agent_cardAgent card and capability discovery types
artifactArtifact types for the A2A protocol
auth_rejectionWhy a request was refused on authentication or authorization grounds
errorA2A protocol error types
eventsServer-sent event types for A2A streaming
extensionsAgent extension and card-signature types
failureWhy a task failed, as a class a caller can match on
idempotencyClient-supplied idempotency keys for message/send, as a declared extension
jsonrpcJSON-RPC 2.0 envelope types
messageMessage types for the A2A protocol
methodThe A2A v1.0 service methods, mirrored from the ratified specification
paramsJSON-RPC method parameter types
protoCanonical A2A protobuf message types (lf.a2a.v1) and conversions (proto feature)
pushPush notification configuration types
responsesRPC method response types
securitySecurity scheme types for A2A agent authentication
serde_helpersSerialization helpers for reducing allocation overhead
signingAgent card signing and verification (spec §10) (signing feature)
taskTask types for the A2A protocol
trace_contextW3C traceparent / tracestate: parse, validate, derive a child
Constant Description
A2A_VERSIONA2A protocol version string, in the Major.Minor wire form ("1.0")
A2A_CONTENT_TYPEThe registered A2A media type (spec §14.1.1), accepted on ingress by the HTTP bindings alongside JSON_CONTENT_TYPE
JSON_CONTENT_TYPEContent type emitted by the JSON-RPC and REST bindings (application/json)
A2A_VERSION_HEADERHTTP header name for the A2A protocol version (A2A-Version)
A2A_EXTENSIONS_HEADERHTTP header name for extension activation (spec §14.2.2)
WEBSOCKET_BINDING_URIThis project's identifier for its §12 WebSocket binding, as AgentInterface::protocol_binding
Type Description
TaskUnit of work with ID, status, history, artifacts
TaskIdNewtype wrapper for task identifiers
TaskStateEnum: Unspecified, Submitted, Working, InputRequired, AuthRequired, Completed, Failed, Canceled, Rejected
TaskStatusState + optional message + timestamp
TaskVersionMonotonically increasing version number
ContextIdConversation context identifier
Type Description
MessageStructured payload with ID, role, parts
MessageIdNewtype wrapper for message identifiers
MessageRoleEnum: Unspecified, User, Agent
PartContent unit: text, raw, url, or data
PartContentEnum: Text, Raw, Url, Data
FileContentContent of a file part. Deprecated: exists for backward compatibility with v0.3; in v1.0 use Part::raw or Part::url
Type Description
ArtifactResult produced by an agent. Call validate() to check non-empty parts.
ArtifactIdNewtype wrapper for artifact identifiers
Type Description
StreamResponseEnum: Task, Message, StatusUpdate, ArtifactUpdate
TaskStatusUpdateEventStatus change notification
TaskArtifactUpdateEventArtifact delivery notification
Type Description
AgentCardRoot discovery document
AgentInterfaceTransport endpoint descriptor
AgentCapabilitiesCapability flags (streaming, push, extended card)
AgentSkillDiscrete agent capability
AgentProviderOrganization info
Type Description
AgentExtensionDescribes an optional extension that an agent supports
AgentCardSignatureA cryptographic signature over an AgentCard
Type Description
SecuritySchemeA security scheme supported by an agent
NamedSecuritySchemesA map from security scheme name to its definition, as used in AgentCard.securitySchemes
SecurityRequirementA security requirement object mapping scheme names to their required scopes
StringListA list of strings used within a SecurityRequirement map value
ApiKeySecuritySchemeAPI key security scheme: a token sent in a header, query parameter, or cookie
ApiKeyLocationWhere an API key is placed in the request
HttpAuthSecuritySchemeHTTP authentication security scheme (Bearer, Basic, etc.)
OAuth2SecuritySchemeOAuth 2.0 security scheme
OAuthFlowsAvailable OAuth 2.0 flows for an OAuth2SecurityScheme
AuthorizationCodeFlowOAuth 2.0 authorization code flow
ClientCredentialsFlowOAuth 2.0 client credentials flow
DeviceCodeFlowOAuth 2.0 device authorization flow (RFC 8628)
ImplicitFlowOAuth 2.0 implicit flow (deprecated; retained for compatibility)
PasswordOAuthFlowOAuth 2.0 resource owner password credentials flow (deprecated but in spec)
OpenIdConnectSecuritySchemeOpenID Connect security scheme
MutualTlsSecuritySchemeMutual TLS security scheme
Type Description
MessageSendParamsSendMessage / SendStreamingMessage input
SendMessageConfigurationOutput modes, history, push config
TaskQueryParamsGetTask input
ListTasksParamsListTasks input with filters and pagination
CancelTaskParamsCancelTask input
TaskIdParamsSubscribeToTask input
GetPushConfigParamsGetTaskPushNotificationConfig input
DeletePushConfigParamsDeleteTaskPushNotificationConfig input
ListPushConfigsParamsListTaskPushNotificationConfigs input
GetExtendedAgentCardParamsGetExtendedAgentCard input
AcceptedFieldsTrait: the JSON keys a request type accepts, in both protobuf spellings
Type Description
TaskPushNotificationConfigWebhook registration
AuthenticationInfoWebhook auth credentials
Type Description
SendMessageResponseEnum: Task or Message
TaskListResponsePaginated task list
ListPushConfigsResponsePaginated push config list
AuthenticatedExtendedCardResponseType alias for AgentCard
Type Description
SerBufferThread-local reusable serialization buffer (2.3x less small-payload overhead)
deser_from_strBorrowed deserialization from &str (~15-25% fewer allocations)
deser_from_sliceBorrowed deserialization from &[u8] (~15-25% fewer allocations)
Function Description
utc_now_iso8601()Returns the current UTC time as an ISO 8601 string with millisecond precision
unix_millis_to_iso8601(millis)Formats Unix-epoch milliseconds as an ISO 8601 UTC string with millisecond precision; pre-epoch clamps to the epoch
parse_iso8601_to_unix_millis(s)Parses an ISO 8601 / RFC 3339 timestamp into milliseconds since the Unix epoch; None for anything structurally invalid
Type Description
A2aErrorProtocol-level error
ErrorCodeStandard error codes
AuthRejectionA refused credential an A2aError carries: its kind and WWW-Authenticate challenge
AuthRejectionKindUnauthenticated (HTTP 401, gRPC UNAUTHENTICATED) or PermissionDenied (HTTP 403, gRPC PERMISSION_DENIED)
A2aResult<T>Alias for Result<T, A2aError>
Type Description
JsonRpcRequestJSON-RPC 2.0 request envelope
JsonRpcErrorJSON-RPC error object
JsonRpcVersionVersion marker ("2.0")
JsonRpcResponseJSON-RPC 2.0 response: either a success with a result or an error with an error object
JsonRpcSuccessResponseA successful JSON-RPC 2.0 response
JsonRpcErrorResponseAn error JSON-RPC 2.0 response
JsonRpcRequestIdA JSON-RPC 2.0 request identifier with three distinct states
JsonRpcIdA JSON-RPC 2.0 response identifier
Module Contents
authAuthentication interceptor and credential storage
builderFluent builder for A2aClient
clientThe A2aClient itself
configClient configuration types
discoveryAgent card discovery with HTTP caching
errorClient error types
interceptorRequest/response interceptor infrastructure
methodsPer-method client helpers
retryConfigurable retry policy for transient client errors
streamingSSE client-side streaming support
testingScriptedPeer: a misbehaving agent on any binding (stall, cut-off, mis-frame, 401), for testing a client's failure handling (testing feature)
tlsTLS connector via rustls (tls-rustls feature)
token_providerToken acquisition: TokenProvider, OAuth 2.0 client-credentials, and OIDC discovery
transportTransport abstraction for A2A client requests
Type Description
A2aClientMain client for calling remote agents
ClientBuilderFluent builder for client configuration
ClientConfigConfiguration for an A2aClient instance
EventStreamAsync SSE event stream
RetryPolicyConfigurable retry with exponential backoff
trace_propagationCarrying W3C trace context on outbound calls
CurrentTraceThe trace the current task runs under, and how to start one
TracePropagationInterceptorWrites traceparent onto every outbound request
ClientErrorErrors that can occur during A2A client operations
ClientResult<T>Alias for Result<T, ClientError>
Function Description
resolve_agent_card(base_url)async — fetches the AgentCard from the standard well-known path; no headers, 30 s budget
resolve_agent_card_with_options(base_url, &options)async — the same with the headers and budget in a CardFetchOptions (discovery module; fetch_card_from_url_with_options for an absolute URL)
Method Returns Description
send_message(params)SendMessageResponseSynchronous send
stream_message(params)EventStreamStreaming send
get_task(params)TaskRetrieve task by ID
list_tasks(params)TaskListResponseQuery tasks
cancel_task(id)TaskCancel a running task
subscribe_to_task(id)EventStreamRe-subscribe to task events
subscribe_to_task_from(id, last_event_id)EventStreamResume a broken stream from its last SSE id: (sends Last-Event-ID)
set_push_config(config)TaskPushNotificationConfigCreate push config
get_push_config(task_id, id)TaskPushNotificationConfigGet push config
list_push_configs(params)ListPushConfigsResponseList push configs
delete_push_config(task_id, id)()Delete push config
get_extended_agent_card()AuthenticatedExtendedCardResponseGet extended card
Type Description
CallInterceptorRequest/response hook trait
InterceptorChainOrdered interceptor sequence
ClientRequestA logical A2A request as seen by interceptors
ClientResponseA logical A2A response as seen by interceptors
Type Description
AuthInterceptorA CallInterceptor that injects Authorization headers from a CredentialsStore
CredentialsStorePersistent storage for auth credentials, keyed by session + scheme
InMemoryCredentialsStoreAn in-memory CredentialsStore backed by an RwLock<HashMap>
SessionIdOpaque identifier for a client authentication session
TokenProviderA source of bearer access tokens
StaticTokenProviderA TokenProvider that always returns the same fixed token
OAuth2ClientCredentialsA TokenProvider implementing the OAuth 2.0 client credentials grant (RFC 6749 §4.4) with caching and proactive refresh
BearerAuthInterceptorA CallInterceptor that injects a bearer token from a TokenProvider before every request
Type Description
TransportPluggable transport trait
JsonRpcTransportJSON-RPC 2.0 transport
RestTransportREST/HTTP transport
WebSocketTransportWebSocket transport (websocket feature)
WebSocketTransportConfigConfiguration for WebSocketTransport::connect_with_config (websocket feature)
GrpcTransportgRPC transport (grpc feature); dials host:port targets and http(s):// URLs
GrpcBareAddressSchemeHow a bare host:port gRPC target is dialled: TLS except loopback (default), always TLS, or always plaintext
Module Contents
agent_cardAgent card HTTP handlers (static, dynamic, and caching utilities)
authServer-side authentication interceptors
builderBuilder for RequestHandler
call_contextCall context for server-side interceptors
conformanceGrades an AgentExecutor against the protocol invariants (conformance feature)
dispatchHTTP dispatch layer — JSON-RPC and REST routing
errorServer-specific error types
executorAgent executor trait
executor_helpersErgonomic helpers for implementing AgentExecutor
handlerCore request handler — protocol logic layer
interceptorServer-side interceptor chain
metricsMetrics hooks for observing handler activity
otelOpenTelemetry integration for the A2A server (otel feature)
pushPush notification configuration storage and delivery
rate_limitFixed-window rate limiter as a ServerInterceptor
request_contextRequest context passed to the AgentExecutor
serveserve(), serve_with_addr, Dispatcher
storeTask storage backend
streamingStreaming infrastructure for SSE responses and event queues
tenant_configPer-tenant resource limits for multi-tenant A2A servers
tenant_resolverTenant resolution for multi-tenant A2A servers
Constant Description
CORS_ALLOW_ALLCORS Access-Control-Allow-Origin header value for public agent cards
A2A_VERSION_METADATA_KEYThe service parameter naming the A2A protocol version, spelled the way a non-HTTP binding carries it
Type Description
RequestHandlerCentral protocol orchestrator
RequestHandlerBuilderFluent builder for handler configuration
RequestContextPer-execution context (task ID, message, etc.)
CancellationTokenThe type of RequestContext::cancellation_token, re-exported so an executor need not depend on tokio-util to name it
CallContextPer-request metadata (request ID, headers, tenant)
HandlerLimitsConfigurable validation limits
InboundTracePolicyWhat this handler does with a traceparent an as-yet unauthenticated peer sent (W3C Trace Context §7.2)
MIN_MESSAGE_ID_LENGTHThe floor message.id's length bound is never taken below: 36, a hyphenated UUID
SendMessageResultResult of RequestHandler::on_send_message: a synchronous response or a streaming reader
ShutdownReportWhat a shutdown actually managed to do (live queues it had to destroy, whether executor cleanup completed)
InFlightReportWhat RequestHandler::finish_in_flight / cancel_in_flight did: tasks that completed on their own, tasks cancelled, still running at the end of the grace period, whether everything finished
ConnectionPoolStatsStatistics about the HTTP connection pool
RpcCallOne finished inbound call as Metrics::on_rpc_call reports it: binding, method, duration, status (rpc.server.call.duration)
Trait Description
AgentExecutorAgent logic entry point
TaskStoreTask persistence backend
PushConfigStorePush config persistence
PushSenderWebhook delivery
ServerInterceptorServer-side middleware
AgentCardProducerDynamic agent card generation
DispatcherHTTP dispatch trait (for serve())
MetricsPluggable metrics observer (requests, latency, errors)
TenantResolverExtracts tenant from request context
RateLimitCounterA request counter every replica shares
Type Description
JsonRpcDispatcherJSON-RPC 2.0 HTTP dispatcher (implements Dispatcher)
RestDispatcherRESTful HTTP dispatcher (implements Dispatcher)
WebSocketDispatcherWebSocket dispatcher (websocket feature)
GrpcDispatchergRPC dispatcher (grpc feature)
A2aRouterAxum framework adapter (axum feature)
Name Description
serve(addr, dispatcher) -> io::Result<()>async — binds and drives the accept loop until the future is dropped
serve_with_addr(addr, dispatcher) -> io::Result<SocketAddr>async — binds, spawns the accept loop, returns the bound SocketAddr (useful for port-0 in tests)
ServerA bound listener that has not started accepting yet; binding is separated from serving so the caller can learn the address
ServeConfigLimits applied to a Server
ServeReportWhat a shutdown did — Server::serve_with_shutdown, or the gRPC and WebSocket dispatchers' serve_with_shutdown: connections accepted, drained or abandoned, and (with a handler-backed dispatcher) the InFlightReport for its tasks
DispatchConfigConfiguration for dispatch-layer limits shared by both JSON-RPC and REST dispatchers
GrpcConfigConfiguration for the gRPC dispatcher (grpc feature)
validate_version_metadata(metadata, required)Validates the A2A version carried in a binding's request metadata
Name Description
agent_executor!Macro: generates an AgentExecutor implementation from a closure-like syntax
boxed_futureWraps an async expression into a pinned, boxed, Send future
Type Description
InMemoryTaskStoreIn-memory task store with TTL
InMemoryPushConfigStoreIn-memory push config store
HttpPushSenderHTTP webhook delivery with SSRF protection
SqliteTaskStoreSQLite task store (sqlite feature)
SqlitePushConfigStoreSQLite push config store (sqlite feature)
TenantAwareInMemoryTaskStoreMulti-tenant in-memory task store
TenantAwareInMemoryPushConfigStoreMulti-tenant in-memory push config store
TenantAwareSqliteTaskStoreMulti-tenant SQLite task store (sqlite feature)
TenantAwareSqlitePushConfigStoreMulti-tenant SQLite push config store (sqlite feature)
PostgresTaskStorePostgreSQL task store (postgres feature)
PostgresPushConfigStorePostgreSQL push config store (postgres feature)
TenantAwarePostgresTaskStoreMulti-tenant PostgreSQL task store (postgres feature)
TenantAwarePostgresPushConfigStoreMulti-tenant PostgreSQL push config store (postgres feature)
PgMigrationRunnerPostgreSQL migration runner (postgres feature)
StaticAgentCardHandlerStatic agent card with HTTP caching
DynamicAgentCardHandlerDynamic agent card with producer
HotReloadAgentCardHandlerAgent card with live reloading
HeaderTenantResolverTenantResolver that reads a configurable request header
BearerTokenTenantResolverTenantResolver that extracts tenant claims from a JWT bearer token
PathSegmentTenantResolverTenantResolver that parses tenant from a configurable path segment
RateLimitInterceptorPer-caller rate limiting interceptor
PostgresRateLimitCounterA RateLimitCounter backed by a PostgreSQL table (postgres feature)
ApiKeyAuthInterceptorRejects requests whose API-key header is absent or not in the allowed set
BearerTokenAuthInterceptorRejects requests whose bearer token is absent or not in the allowed set
ServerInterceptorChainAn ordered chain of ServerInterceptor instances
CallOutcomeHow a call ended — succeeded, failed with the error sent, or cancelled — as ServerInterceptor::on_complete is told
MigrationA single SQLite schema migration (sqlite feature)
MigrationRunnerRuns schema migrations against a SQLite database (sqlite feature)
PgMigrationA single PostgreSQL schema migration (postgres feature)
NoopMetricsNo-op metrics implementation (default)
OtelMetricsOpenTelemetry metrics (otel feature)
Name Kind Description
EventEmitterstruct Ergonomic event emission helper (wraps an EventQueueWriter)
EventQueueWritertrait Write events to a task's event stream
EventQueueReadertrait Read events from a task's event stream
EventQueueManagerstruct Per-task queue lifecycle manager (create / lookup / destroy)
InMemoryQueueWriterstruct Bounded-channel EventQueueWriter implementation
InMemoryQueueReaderstruct Bounded-channel EventQueueReader implementation
StreamEventstruct One queued event and its position in the task's event log (the SSE id:)
Type Description
CorsConfigCross-origin policy
TaskStoreConfigTTL and capacity for in-memory store
TenantStoreConfigConfiguration for TenantAwareInMemoryTaskStore
TenantContextThread-safe tenant context for scoping store operations
PerTenantConfigPer-tenant configuration for timeouts, capacity limits, and executor selection
TenantLimitsResource limits declared for a single tenant
RateLimitConfigConfiguration for RateLimitInterceptor
PushRetryPolicyRetry policy for push notification delivery
ServerErrorServer-level error type
ServerResult<T>Alias for Result<T, ServerError>
Module Re-exports
a2a_protocol_sdk::typesAll a2a-protocol-types exports
a2a_protocol_sdk::clientAll a2a-protocol-client exports
a2a_protocol_sdk::serverAll a2a-protocol-server exports
a2a_protocol_sdk::preludeMost commonly used types
The prelude includes the most commonly used types from all three crates — see Project Structure for the full list.
use a2a_protocol_sdk::prelude::*;
use a2a_protocol_sdk::types::push::TaskPushNotificationConfig;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let base64_string = "aGVsbG8=";
let card = AgentCard::new("a", "1.0.0", AgentInterface::jsonrpc("http://localhost:3000"));
// Task status
TaskStatus::new(TaskState::Working);
TaskStatus::with_timestamp(TaskState::Completed);
// Messages and parts (v1.0 wire format: flat oneof)
Part::text("hello"); // → {"text": "hello"}
Part::raw(base64_string); // → {"raw": "aGVsbG8="}
Part::url("https://..."); // → {"url": "https://..."}
Part::data(serde_json::json!({"k": 1})); // → {"data": {"k": 1}}
Part::file_bytes(base64_string); // backward-compat alias for raw()
Part::file_uri("https://..."); // backward-compat alias for url()
let wire = |p: Part| serde_json::to_value(p).unwrap();
assert_eq!(wire(Part::text("hello")), serde_json::json!({"text": "hello"}));
assert_eq!(wire(Part::raw(base64_string)), serde_json::json!({"raw": "aGVsbG8="}));
assert_eq!(wire(Part::url("https://...")), serde_json::json!({"url": "https://..."}));
assert_eq!(wire(Part::data(serde_json::json!({"k": 1}))), serde_json::json!({"data": {"k": 1}}));
assert_eq!(wire(Part::file_bytes(base64_string)), wire(Part::raw(base64_string)));
assert_eq!(wire(Part::file_uri("https://...")), wire(Part::url("https://...")));
// 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);
// Agent cards: the three fields `validate` requires, the rest by `with_*`
AgentCard::new("my-agent", "1.0.0", AgentInterface::jsonrpc("http://localhost:3000"))
.with_description("Does one thing well")
.with_skill(AgentSkill::new("echo", "Echo", "Repeats").with_tags(["text"]))
.with_interface(AgentInterface::grpc("http://localhost:50051"))
.with_streaming(true); // one flag; with_capabilities(..) for the rest
// Client-side: which interface `from_card` picked
ClientBuilder::from_card(&card)?.chosen_interface(); // Option<&AgentInterface>
// Push configs
TaskPushNotificationConfig::new("task-id", "https://webhook.url");
Ok(())
}