Skip to main content

Module server

Module server 

Source
Expand description

Server framework for implementing A2A agents.

Modules§

agent_card
Agent card HTTP handlers (static, dynamic, and caching utilities).
builder
Builder for RequestHandler.
call_context
Call context for server-side interceptors.
dispatch
HTTP dispatch layer — JSON-RPC and REST routing.
error
Server-specific error types.
executor
Agent executor trait.
executor_helpers
Ergonomic helpers for implementing AgentExecutor.
handler
Core request handler — protocol logic layer.
interceptor
Server-side interceptor chain.
metrics
Metrics hooks for observing handler activity.
otel
OpenTelemetry integration for the A2A server.
push
Push notification configuration storage and delivery.
rate_limit
Token-bucket rate limiter as a ServerInterceptor.
request_context
Request context passed to the AgentExecutor.
serve
Server startup helpers.
store
Task storage backend.
streaming
Streaming infrastructure for SSE responses and event queues.
tenant_config
Per-tenant configuration for multi-tenant A2A servers.
tenant_resolver
Tenant resolution for multi-tenant A2A servers.

Macros§

agent_executor
Generates an AgentExecutor implementation from a closure-like syntax.

Structs§

A2aRouter
Builder for an Axum Router that serves all A2A v1.0 protocol methods.
BearerTokenTenantResolver
Extracts a tenant ID from the Authorization: Bearer <token> header.
CallContext
Metadata about the current server-side method call.
ConnectionPoolStats
Statistics about the HTTP connection pool.
CorsConfig
CORS configuration for A2A dispatchers.
DispatchConfig
Configuration for dispatch-layer limits shared by both JSON-RPC and REST dispatchers.
DynamicAgentCardHandler
Serves a dynamically generated AgentCard as a JSON HTTP response.
EventEmitter
Ergonomic helper for emitting status and artifact events from an executor.
EventQueueManager
Manages event queues for active tasks.
GrpcConfig
Configuration for the gRPC dispatcher.
GrpcDispatcher
gRPC dispatcher that routes A2A requests to a RequestHandler.
HandlerLimits
Configurable limits for the request handler.
HeaderTenantResolver
Extracts a tenant ID from a configurable HTTP header.
HotReloadAgentCardHandler
An agent card handler that supports hot-reloading.
HttpPushSender
HTTP-based PushSender using hyper.
InMemoryPushConfigStore
In-memory PushConfigStore backed by a HashMap.
InMemoryQueueReader
In-memory EventQueueReader backed by a broadcast channel receiver.
InMemoryQueueWriter
In-memory EventQueueWriter backed by a broadcast channel sender.
InMemoryTaskStore
In-memory TaskStore backed by a BTreeMap under a RwLock.
JsonRpcDispatcher
JSON-RPC 2.0 request dispatcher.
Migration
A single schema migration.
MigrationRunner
Runs schema migrations against a SQLite database.
OtelMetrics
A Metrics implementation backed by OpenTelemetry instruments.
PathSegmentTenantResolver
Extracts a tenant ID from a URL path segment by index.
PerTenantConfig
Per-tenant configuration for timeouts, capacity limits, and executor selection.
PgMigration
A single schema migration.
PgMigrationRunner
Runs schema migrations against a PostgreSQL database.
PostgresPushConfigStore
PostgreSQL-backed PushConfigStore.
PostgresTaskStore
PostgreSQL-backed TaskStore.
PushRetryPolicy
Retry policy for push notification delivery.
RateLimitConfig
Configuration for RateLimitInterceptor.
RateLimitInterceptor
A fixed-window rate limiting ServerInterceptor.
RequestContext
Context for a single agent execution request.
RequestHandler
The core protocol logic handler.
RequestHandlerBuilder
Fluent builder for RequestHandler.
RestDispatcher
REST HTTP request dispatcher.
ServerInterceptorChain
An ordered chain of ServerInterceptor instances.
SqlitePushConfigStore
SQLite-backed PushConfigStore.
SqliteTaskStore
SQLite-backed TaskStore.
StaticAgentCardHandler
Serves a pre-serialized AgentCard as a JSON HTTP response with caching.
TaskStoreConfig
Configuration for InMemoryTaskStore.
TenantAwareInMemoryPushConfigStore
Tenant-isolated in-memory PushConfigStore.
TenantAwareInMemoryTaskStore
Tenant-isolated in-memory TaskStore.
TenantAwarePostgresPushConfigStore
Tenant-scoped PostgreSQL-backed PushConfigStore.
TenantAwarePostgresTaskStore
Tenant-scoped PostgreSQL-backed TaskStore.
TenantAwareSqlitePushConfigStore
Tenant-scoped SQLite-backed PushConfigStore.
TenantAwareSqliteTaskStore
Tenant-scoped SQLite-backed TaskStore.
TenantContext
Thread-safe tenant context for scoping store operations.
TenantLimits
Resource limits and configuration for a single tenant.
TenantStoreConfig
Configuration for TenantAwareInMemoryTaskStore.
WebSocketDispatcher
WebSocket-based A2A dispatcher.

Enums§

SendMessageResult
Result of RequestHandler::on_send_message.
ServerError
Server framework error type.

Constants§

CORS_ALLOW_ALL
CORS Access-Control-Allow-Origin header value for public agent cards.

Traits§

AgentCardProducer
Trait for producing an AgentCard dynamically.
AgentExecutor
Trait for implementing A2A agent execution logic.
Dispatcher
Trait for types that can dispatch HTTP requests to an A2A handler.
EventQueueReader
Trait for reading streaming events.
EventQueueWriter
Trait for writing streaming events.
Metrics
Trait for receiving metrics callbacks from the handler.
PushConfigStore
Trait for storing push notification configurations.
PushSender
Trait for delivering push notifications to client webhooks.
ServerInterceptor
A server-side interceptor for request processing.
TaskStore
Trait for persisting and retrieving Task objects.
TenantResolver
Trait for extracting a tenant identifier from incoming requests.

Functions§

boxed_future
Wraps an async expression into Pin<Box<dyn Future<Output = T> + Send + 'a>>.
serve
Starts an HTTP server that dispatches requests using the given dispatcher.
serve_with_addr
Starts an HTTP server and returns the bound SocketAddr.

Type Aliases§

ServerResult
Convenience type alias: Result<T, ServerError>.