pub struct Executor { /* private fields */ }Implementations§
Source§impl Executor
impl Executor
pub fn new(config: ExecutorConfig) -> Self
Sourcepub async fn execute(
&self,
context_id: &str,
task_id: &str,
message: &Message,
) -> Result<Vec<UpdateEvent>>
pub async fn execute( &self, context_id: &str, task_id: &str, message: &Message, ) -> Result<Vec<UpdateEvent>>
Runs message in the session named by context_id for an unauthenticated caller.
The session belongs to the synthetic user A2A_USER_{context_id}. Use
execute_for_user when the request carries an
authenticated principal, so a caller who knows another caller’s contextId
cannot reach that caller’s session.
§Errors
Returns an error when the session cannot be prepared, the message cannot be converted, or the runner fails to start.
Sourcepub async fn execute_for_user(
&self,
user_id: Option<&str>,
context_id: &str,
task_id: &str,
message: &Message,
) -> Result<Vec<UpdateEvent>>
pub async fn execute_for_user( &self, user_id: Option<&str>, context_id: &str, task_id: &str, message: &Message, ) -> Result<Vec<UpdateEvent>>
Runs message in the session named by context_id, owned by user_id.
user_id is the authenticated principal. When it is None the session
belongs to the synthetic user A2A_USER_{context_id}, which is only safe
when no authentication is configured.
§Example
let events = executor
.execute_for_user(Some("alice"), "ctx-1", "task-1", &message)
.await?;§Errors
Returns an error when the session cannot be prepared, the message cannot be converted, or the runner fails to start.
pub async fn cancel( &self, context_id: &str, task_id: &str, ) -> Result<TaskStatusUpdateEvent>
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl !UnwindSafe for Executor
impl Forget for Executor
impl Freeze for Executorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<RunnerConfig> is !null: Freeze,
PhantomData<ArcInner<RunnerConfig>>: Freeze,
*const ArcInner<TreeNode> is !null: Freeze,
PhantomData<ArcInner<TreeNode>>: Freeze,
*const ArcInner<InterceptorChain> is !null: Freeze,
PhantomData<ArcInner<InterceptorChain>>: Freeze,
impl Move for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<RunnerConfig> is !null: UnsafeUnpin,
PhantomData<ArcInner<RunnerConfig>>: UnsafeUnpin,
*const ArcInner<TreeNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,
*const ArcInner<InterceptorChain> is !null: UnsafeUnpin,
PhantomData<ArcInner<InterceptorChain>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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 more