#[non_exhaustive]pub enum TaskState {
Unspecified,
Submitted,
Working,
InputRequired,
AuthRequired,
Completed,
Failed,
Canceled,
Rejected,
}Expand description
The lifecycle state of a Task.
Per v1.0 spec (Section 5.5), enum values use ProtoJSON SCREAMING_SNAKE_CASE:
"TASK_STATE_COMPLETED", "TASK_STATE_INPUT_REQUIRED", etc.
Legacy lowercase/kebab-case values are accepted on deserialization.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unspecified
Proto default (0-value); should not appear in normal usage.
Submitted
Task received, not yet started.
Working
Task is actively being processed.
InputRequired
Agent requires additional input from the client to proceed.
AuthRequired
Agent requires the client to complete an authentication step.
Completed
Task finished successfully.
Failed
Task finished with an error.
Canceled
Task was canceled by the client.
Rejected
Task was rejected by the agent before execution.
Implementations§
Source§impl TaskState
impl TaskState
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Returns true if this state is a terminal (final) state.
Terminal states: Completed, Failed, Canceled, Rejected.
Sourcepub const fn is_interrupted(self) -> bool
pub const fn is_interrupted(self) -> bool
Returns true if this state is an interrupted state.
Interrupted states: InputRequired, AuthRequired.
Per Section 3.2.2, blocking SendMessage MUST return when the task
reaches a terminal OR interrupted state.
Sourcepub const fn can_transition_to(self, next: TaskState) -> bool
pub const fn can_transition_to(self, next: TaskState) -> bool
Returns true if transitioning from self to next is a valid
state transition per the A2A protocol.
Terminal states cannot transition to any other state.
Unspecified can transition to any state.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskState
impl<'de> Deserialize<'de> for TaskState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TaskState
impl Serialize for TaskState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for TaskState
impl Eq for TaskState
impl StructuralPartialEq for TaskState
Auto Trait Implementations§
impl Freeze for TaskState
impl RefUnwindSafe for TaskState
impl Send for TaskState
impl Sync for TaskState
impl Unpin for TaskState
impl UnsafeUnpin for TaskState
impl UnwindSafe for TaskState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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 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>
T in a tonic::Request