#[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: Self) -> bool
pub const fn can_transition_to(self, next: Self) -> 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.