#[non_exhaustive]pub struct Lineage {
pub root: String,
pub depth: u32,
pub parent_task_id: Option<String>,
}Expand description
Where a task sits in its job’s tree. See the module docs.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.root: StringThe job: the root of the tree.
depth: u32Hops from the job’s first task, which is at 0. Read from any JSON
number with a whole value (2 or 2.0; see whole_number).
parent_task_id: Option<String>The delegating task’s id on its own agent, when the sender gave it.
Implementations§
Source§impl Lineage
impl Lineage
Sourcepub fn origin(root: impl Into<String>) -> Lineage
pub fn origin(root: impl Into<String>) -> Lineage
The first task of the job root: depth 0, no parent.
Sourcepub fn child(
&self,
parent_task_id: impl Into<String>,
) -> Result<Lineage, A2aError>
pub fn child( &self, parent_task_id: impl Into<String>, ) -> Result<Lineage, A2aError>
The lineage of a task this one delegates, from the task
parent_task_id: the same root, one level deeper.
§Errors
Invalid params when the child would be deeper than
MAX_LINEAGE_DEPTH, or parent_task_id is not a valid id: refused
here, at the parent, rather than by the child’s server.
Sourcepub fn attach(&self, message: &mut Message)
pub fn attach(&self, message: &mut Message)
Records the lineage on a message, declaring the extension once.
Sourcepub fn read(message: &Message) -> Result<Option<Lineage>, A2aError>
pub fn read(message: &Message) -> Result<Option<Lineage>, A2aError>
The lineage a message carries, if any, checked.
§Errors
Invalid params when the message carries the key but not a valid lineage.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lineage
impl<'de> Deserialize<'de> for Lineage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Lineage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Lineage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Lineage
Source§impl Serialize for Lineage
impl Serialize for Lineage
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 StructuralPartialEq for Lineage
Auto Trait Implementations§
impl Forget for Lineage
impl Freeze for Lineage
impl Move for Lineage
impl RefUnwindSafe for Lineage
impl Send for Lineage
impl Sync for Lineage
impl Unpin for Lineage
impl UnsafeUnpin for Lineage
impl UnwindSafe for Lineage
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].