pub struct A2aRouter { /* private fields */ }Expand description
Builder for an Axum Router that serves all A2A v1.0 protocol methods.
Wraps an existing RequestHandler — all business logic, storage, and
interceptors are inherited. This is a thin HTTP routing layer only.
§REST routes
| Method | Path | A2A Method |
|---|---|---|
POST | /message:send | SendMessage |
POST | /message:stream | SendStreamingMessage |
GET | /tasks | ListTasks |
GET | /tasks/:id | GetTask |
POST | /tasks/:id:cancel | CancelTask |
POST or GET | /tasks/:id:subscribe | SubscribeToTask |
POST | /tasks/:task_id/pushNotificationConfigs | CreateTaskPushNotificationConfig |
GET | /tasks/:task_id/pushNotificationConfigs | ListTaskPushNotificationConfigs |
GET | /tasks/:task_id/pushNotificationConfigs/:id | GetTaskPushNotificationConfig |
DELETE | /tasks/:task_id/pushNotificationConfigs/:id | DeleteTaskPushNotificationConfig |
GET | /extendedAgentCard | GetExtendedAgentCard |
GET | /.well-known/agent.json | Agent Card Discovery |
GET | /health | Health check |
Implementations§
Source§impl A2aRouter
impl A2aRouter
Sourcepub fn new(handler: Arc<RequestHandler>) -> A2aRouter
pub fn new(handler: Arc<RequestHandler>) -> A2aRouter
Creates a new A2aRouter wrapping the given handler.
Sourcepub const fn with_config(
handler: Arc<RequestHandler>,
config: DispatchConfig,
) -> A2aRouter
pub const fn with_config( handler: Arc<RequestHandler>, config: DispatchConfig, ) -> A2aRouter
Creates a new A2aRouter with custom dispatch configuration.
Sourcepub fn into_router(self) -> Router
pub fn into_router(self) -> Router
Builds the Axum Router with all A2A REST routes.
The router uses Arc<RequestHandler> as shared state (via Axum’s
State extractor). Returns the configured Router.
Auto Trait Implementations§
impl Freeze for A2aRouter
impl !RefUnwindSafe for A2aRouter
impl Send for A2aRouter
impl Sync for A2aRouter
impl Unpin for A2aRouter
impl UnsafeUnpin for A2aRouter
impl !UnwindSafe for A2aRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request