#[repr(i32)]pub enum TaskState {
TASK_STATE_UNSPECIFIED = 0,
TASK_STATE_SUBMITTED = 1,
TASK_STATE_WORKING = 2,
TASK_STATE_COMPLETED = 3,
TASK_STATE_FAILED = 4,
TASK_STATE_CANCELED = 5,
TASK_STATE_INPUT_REQUIRED = 6,
TASK_STATE_REJECTED = 7,
TASK_STATE_AUTH_REQUIRED = 8,
}Variants§
TASK_STATE_UNSPECIFIED = 0
TASK_STATE_SUBMITTED = 1
TASK_STATE_WORKING = 2
TASK_STATE_COMPLETED = 3
TASK_STATE_FAILED = 4
TASK_STATE_CANCELED = 5
TASK_STATE_INPUT_REQUIRED = 6
TASK_STATE_REJECTED = 7
TASK_STATE_AUTH_REQUIRED = 8
Implementations§
Source§impl TaskState
impl TaskState
pub const Submitted: Self = Self::TASK_STATE_SUBMITTED
pub const Working: Self = Self::TASK_STATE_WORKING
pub const InputRequired: Self = Self::TASK_STATE_INPUT_REQUIRED
pub const Completed: Self = Self::TASK_STATE_COMPLETED
pub const Canceled: Self = Self::TASK_STATE_CANCELED
pub const Failed: Self = Self::TASK_STATE_FAILED
pub const Rejected: Self = Self::TASK_STATE_REJECTED
pub const AuthRequired: Self = Self::TASK_STATE_AUTH_REQUIRED
pub const Unknown: Self = Self::TASK_STATE_UNSPECIFIED
pub fn is_terminal(&self) -> bool
Sourcepub fn is_interrupted(&self) -> bool
pub fn is_interrupted(&self) -> bool
The spec’s interrupted states: the agent has stopped and is waiting on the caller. Not terminal — the task resumes once the caller supplies what it asked for — but a caller polling for progress should stop here too.
Sourcepub fn is_settled(&self) -> bool
pub fn is_settled(&self) -> bool
Whether the task has stopped and will not advance on its own — terminal, or interrupted waiting on the caller.
This is the spec’s own stopping condition for a blocking SendMessage:
return_immediately = false obliges the server to wait for a terminal
or interrupted state (spec/a2a.proto:155). It is also where a
subscription ends, and where a polling client stops. Those three had
each spelled the condition out separately.
Sourcepub fn is_cancelable(&self) -> bool
pub fn is_cancelable(&self) -> bool
Whether a client may still cancel a task in this state.
Everything that has not finished: queued (SUBMITTED), running
(WORKING), and the interrupted states — cancelling an INPUT_REQUIRED
task is exactly how a client says “never mind”. Only the terminal states
refuse, because there is nothing left to stop.
Defined here rather than in each storage adapter so the rule has one home: a state added later is cancelable unless it is declared terminal, which is the safe direction to be wrong in — the alternative strands a task no client can get rid of.
Trait Implementations§
impl Copy for TaskState
Source§impl<'de> Deserialize<'de> for TaskState
impl<'de> Deserialize<'de> for TaskState
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Enumeration for TaskState
impl Enumeration for TaskState
Source§fn proto_name(&self) -> &'static str
fn proto_name(&self) -> &'static str
.proto file.impl Eq for TaskState
Source§impl ProtoElemJson for TaskState
impl ProtoElemJson for TaskState
Source§fn serialize_proto_json<S: Serializer>(
v: &Self,
s: S,
) -> Result<S::Ok, S::Error>
fn serialize_proto_json<S: Serializer>( v: &Self, s: S, ) -> Result<S::Ok, S::Error>
Source§fn deserialize_proto_json<'de, D: Deserializer<'de>>(
d: D,
) -> Result<Self, D::Error>
fn deserialize_proto_json<'de, D: Deserializer<'de>>( d: D, ) -> Result<Self, D::Error>
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<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