pub struct A2aController { /* private fields */ }Expand description
Controller for A2A protocol endpoints.
When the request carries an authenticated principal, the principal owns the
session and every task it starts: the session user is the principal’s
user_id, and tasks/get and tasks/cancel only reach that principal’s
tasks. Without authentication the session user is A2A_USER_{contextId}.
Implementations§
Source§impl A2aController
impl A2aController
pub fn new(config: ServerConfig, base_url: &str) -> Self
Sourcepub fn with_skill_index(
config: ServerConfig,
base_url: &str,
skill_index: Arc<SkillIndex>,
) -> Self
pub fn with_skill_index( config: ServerConfig, base_url: &str, skill_index: Arc<SkillIndex>, ) -> Self
Create a controller whose agent card also lists the skills in skill_index.
The indexed skills are appended to the agent-derived skills[] entries
via agent_skills_from_index and
served at /.well-known/agent.json.
Sourcepub fn with_task_retention(self, retention: A2aTaskRetention) -> Self
pub fn with_task_retention(self, retention: A2aTaskRetention) -> Self
Replaces the bounds on retained finished-task records.
Call this before the controller serves requests: it starts a fresh store.
§Example
ⓘ
use adk_server::{A2aController, A2aTaskRetention};
let controller = A2aController::new(config, "http://localhost:8080")
.with_task_retention(A2aTaskRetention::default().with_max_finished(100));Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for A2aController
impl !UnwindSafe for A2aController
impl Freeze for A2aController
impl Send for A2aController
impl Sync for A2aController
impl Unpin for A2aController
impl UnsafeUnpin for A2aController
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