#[non_exhaustive]pub enum TaskState {
Unspecified,
Submitted,
Working,
InputRequired,
AuthRequired,
Completed,
Failed,
Canceled,
Rejected,
}Expand description
The lifecycle state of a Task.
Serializes as lowercase kebab-case (e.g. "completed", "input-required").
Also accepts the legacy TASK_STATE_* format on deserialization for
backward compatibility.
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 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.