pub struct A2AServer {
pub agent_card: AgentCard,
pub registry: AgentCardRegistry,
pub profile_store: ProfileStore,
/* private fields */
}Expand description
A2A server for handling incoming JSON-RPC requests.
This is a protocol server (request router + in-memory task store), not a network server. A shell crate is responsible for exposing it over HTTP/SSE.
Fields§
§agent_card: AgentCardThis agent’s card.
registry: AgentCardRegistryRegistry of known agents.
profile_store: ProfileStoreProfile store for bearer token authentication.
Implementations§
Source§impl A2AServer
impl A2AServer
Sourcepub fn handle_request(&self, request: A2ARequest) -> A2AResponse
pub fn handle_request(&self, request: A2ARequest) -> A2AResponse
Handle an incoming JSON-RPC request.
Sourcepub fn handle_request_with_auth(
&self,
request: A2ARequest,
auth_token: Option<&str>,
) -> A2AResponse
pub fn handle_request_with_auth( &self, request: A2ARequest, auth_token: Option<&str>, ) -> A2AResponse
Handle an incoming JSON-RPC request with an optional bearer token.
Sourcepub fn get_task_caller(&self, task_id: &str) -> Option<AgentProfile>
pub fn get_task_caller(&self, task_id: &str) -> Option<AgentProfile>
Get the caller profile for a task (if known).
Sourcepub fn subscribe_events(&self) -> Receiver<A2ATaskEvent>
pub fn subscribe_events(&self) -> Receiver<A2ATaskEvent>
Subscribe to task lifecycle events for streaming adapters.
Sourcepub fn list_tasks(&self) -> Vec<A2ATask>
pub fn list_tasks(&self) -> Vec<A2ATask>
List currently known tasks.
Sourcepub fn update_task_status(
&self,
task_id: &str,
status: TaskStatus,
) -> Result<(), String>
pub fn update_task_status( &self, task_id: &str, status: TaskStatus, ) -> Result<(), String>
Update task status (for internal use).
Sourcepub fn update_task_status_with_reason(
&self,
task_id: &str,
status: TaskStatus,
reason: impl Into<String>,
) -> Result<(), String>
pub fn update_task_status_with_reason( &self, task_id: &str, status: TaskStatus, reason: impl Into<String>, ) -> Result<(), String>
Update task status and message for internal execution bridges.
Sourcepub fn update_task_progress(
&self,
task_id: &str,
progress: RemoteTaskProgress,
) -> Result<(), String>
pub fn update_task_progress( &self, task_id: &str, progress: RemoteTaskProgress, ) -> Result<(), String>
Report in-flight task progress for internal execution bridges.
Sourcepub fn add_message(
&self,
task_id: &str,
message: A2AMessage,
) -> Result<(), String>
pub fn add_message( &self, task_id: &str, message: A2AMessage, ) -> Result<(), String>
Append a message to a task for final result delivery.
Auto Trait Implementations§
impl !Freeze for A2AServer
impl RefUnwindSafe for A2AServer
impl Send for A2AServer
impl Sync for A2AServer
impl Unpin 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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].