Skip to main content

DelegationOptions

Struct DelegationOptions 

Source
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

Source

pub fn new() -> DelegationOptions

No lease, no budget, no journal, and the default resume policy.

Source

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).

Source

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.

Source

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).

Source

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.

Source

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.

Source

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.

Source

pub const fn with_resume(self, policy: ResumePolicy) -> DelegationOptions

Sets how a lost stream is resumed (see ResumePolicy).

Source

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).

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for DelegationOptions

Source§

fn default() -> DelegationOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more