pub struct DelegationOptions { /* private fields */ }Expand description
What a delegation is given beyond its message: a lease, a budget, a
journal record, how a lost stream is resumed. Nothing is set by default,
which is Delegation::start.
Implementations§
Source§impl DelegationOptions
impl DelegationOptions
Sourcepub fn new() -> DelegationOptions
pub fn new() -> DelegationOptions
No lease, no budget, no journal, and the default resume policy.
Sourcepub const fn with_lease(self, ttl: Duration) -> DelegationOptions
pub const fn with_lease(self, ttl: Duration) -> DelegationOptions
Grants the child a lease of ttl, renewed every third of ttl until
the handle ends (see Delegation::start_leased).
Sourcepub fn with_budget(self, grant: ChildGrant) -> DelegationOptions
pub fn with_budget(self, grant: ChildGrant) -> DelegationOptions
Gives the child grant, a budget carved out of the parent’s (see
Delegation::start_budgeted). A reattach cannot restore a grant.
Sourcepub fn with_journal(
self,
journal: Arc<dyn DelegationJournal>,
owner: impl Into<String>,
agent: impl Into<String>,
) -> DelegationOptions
pub fn with_journal( self, journal: Arc<dyn DelegationJournal>, owner: impl Into<String>, agent: impl Into<String>, ) -> DelegationOptions
Records the delegation in journal as a new record, owned by owner
and naming agent, written before the message is sent (see
Delegation::start_journaled).
Sourcepub fn with_journal_record(
self,
journal: Arc<dyn DelegationJournal>,
record: impl Into<String>,
) -> DelegationOptions
pub fn with_journal_record( self, journal: Arc<dyn DelegationJournal>, record: impl Into<String>, ) -> DelegationOptions
Keeps record, a record in journal that
DelegationJournal::open listed, up to date: for
Delegation::reattach_with.
Sourcepub fn resending(
self,
journal: Arc<dyn DelegationJournal>,
record: DelegationRecord,
) -> DelegationOptions
pub fn resending( self, journal: Arc<dyn DelegationJournal>, record: DelegationRecord, ) -> DelegationOptions
Sends the message again for record, a record in journal that
DelegationJournal::open listed with no task id: its supervisor
died, or its start failed, before the child was named
(Delegation::start_with). The message goes out under the record’s
idempotency key, so an agent that honours keys answers with the child
the first send created instead of starting another, and the record is
kept up to date from then on. The message must be the one first sent:
the journal keeps none.
Sourcepub fn with_lineage(self, lineage: Lineage) -> DelegationOptions
pub fn with_lineage(self, lineage: Lineage) -> DelegationOptions
Gives the child lineage, the job it belongs to (ADR 0034): from an
executor, RequestContext::child_lineage in a2a-protocol-server,
which names this turn’s job one level down with this task as the
parent. Then halting the job by its root stops the child on an agent
that honours the extension, as it stops this turn. An agent that does
not ignores it. A reattach sends no message, so it carries none.
Sourcepub const fn with_resume(self, policy: ResumePolicy) -> DelegationOptions
pub const fn with_resume(self, policy: ResumePolicy) -> DelegationOptions
Sets how a lost stream is resumed (see ResumePolicy).
Sourcepub const fn with_id_wait(self, wait: Duration) -> DelegationOptions
pub const fn with_id_wait(self, wait: Duration) -> DelegationOptions
Sets how long a cancel waits for the child’s id (see
Delegation::with_id_wait).
Sourcepub const fn with_hand_off(self, policy: HandOffPolicy) -> DelegationOptions
pub const fn with_hand_off(self, policy: HandOffPolicy) -> DelegationOptions
Sets how a child whose turn a shutdown handed back is continued (see
HandOffPolicy; the default continues three times).
HandOffPolicy::never opts out.
Trait Implementations§
Source§impl Debug for DelegationOptions
impl Debug for DelegationOptions
Source§impl Default for DelegationOptions
impl Default for DelegationOptions
Source§fn default() -> DelegationOptions
fn default() -> DelegationOptions
Auto Trait Implementations§
impl !RefUnwindSafe for DelegationOptions
impl !UnwindSafe for DelegationOptions
impl Forget for DelegationOptions
impl Freeze for DelegationOptions
impl Move for DelegationOptions
impl Send for DelegationOptions
impl Sync for DelegationOptions
impl Unpin for DelegationOptions
impl UnsafeUnpin for DelegationOptions
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
§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].