pub struct A2aServer;Available on crate features
a2a-v1 and server only.Expand description
Convenience wrapper for quickly starting an A2A-capable server.
Provides two entry points:
A2aServer::quick_startfor zero-config usageA2aServer::builderfor custom configuration
§Example
ⓘ
use adk_server::a2a::convenience::A2aServer;
use std::sync::Arc;
let app = A2aServer::quick_start(my_agent);
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await?;
axum::serve(listener, app).await?;Implementations§
Source§impl A2aServer
impl A2aServer
Sourcepub fn quick_start(agent: Arc<dyn Agent>) -> Router
pub fn quick_start(agent: Arc<dyn Agent>) -> Router
Create an A2A-ready Axum app with sensible defaults.
Uses an in-memory session service, binds to http://localhost:8080,
enables streaming, and auto-generates the agent card from agent metadata.
§Arguments
agent- The agent to expose via A2A protocol
§Example
ⓘ
use adk_server::a2a::convenience::A2aServer;
use std::sync::Arc;
let app = A2aServer::quick_start(my_agent);
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await?;
axum::serve(listener, app).await?;Sourcepub fn builder() -> A2aServerBuilder
pub fn builder() -> A2aServerBuilder
Auto Trait Implementations§
impl Freeze for A2aServer
impl RefUnwindSafe for A2aServer
impl Send for A2aServer
impl Sync for A2aServer
impl Unpin for A2aServer
impl UnsafeUnpin for A2aServer
impl UnwindSafe for A2aServer
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