Skip to main content

ExecCtxBuilder

Struct ExecCtxBuilder 

Source
pub struct ExecCtxBuilder { /* private fields */ }
Expand description

Builder for ExecCtx.

Implementations§

Source§

impl ExecCtxBuilder

Source

pub fn client(self, client: Client) -> Self

Set the HTTP client. If not set, a default client is created.

Source

pub fn backend(self, backend: Arc<dyn Backend>) -> Self

Set the LLM backend. Default: OllamaBackend.

Source

pub fn backoff(self, config: BackoffConfig) -> Self

Set the transport retry configuration. Default: BackoffConfig::none().

Source

pub fn vars(self, vars: HashMap<String, String>) -> Self

Set all template variables at once.

Source

pub fn var(self, key: impl Into<String>, value: impl Into<String>) -> Self

Insert a single template variable.

Source

pub fn cancellation(self, cancel: Option<Arc<AtomicBool>>) -> Self

Set the cancellation flag.

Source

pub fn event_handler(self, handler: Arc<dyn EventHandler>) -> Self

Set the event handler.

Source

pub fn timeout(self, timeout: Duration) -> Self

Set the client-level connection timeout. Default: 5 minutes (safety net).

This is a coarse safety net on the reqwest::Client. Per-request timeouts are applied individually via PipelineLimits::request_timeout or LlmCall::with_timeout.

If a custom Client is provided via .client(), this setting is ignored (the custom client’s own timeout applies).

Source

pub fn with_trace_id(self, trace_id: TraceId) -> Self

👎Deprecated since 0.6.0:

Use with_trace_ctx() instead. This method will be removed in v1.0.

Phase status: compatibility / migration-only

Set the legacy trace ID for correlating operations. If not set, a random UUID v4 is generated automatically.

Prefer with_trace_ctx for new code.

Removal condition: removed when all callers migrate to TraceCtx.

Source

pub fn with_trace_ctx(self, trace_ctx: TraceCtx) -> Self

Set the canonical trace context from stack_ids::TraceCtx.

This is the normal-path trace form. When set, the legacy trace_id field is derived from trace_ctx.trace_id for backward compatibility.

Source

pub fn with_limits(self, limits: PipelineLimits) -> Self

Set resource limits. If not set, PipelineLimits::default() is used.

Source

pub fn build(self) -> ExecCtx

Build the execution context.

Preferred: use with_trace_ctx() to set trace identity. The legacy with_trace_id() method is deprecated.

Resolution order for trace identity:

  1. (Canonical) If trace_ctx was set explicitly via with_trace_ctx(), use it. Derive legacy trace_id from it at the compatibility boundary.
  2. (Legacy/compat) If only trace_id was set via deprecated with_trace_id(), derive trace_ctx from it.
  3. (Default) If neither was set, generate a fresh TraceCtx and derive legacy trace_id.

The legacy trace_id is always derived — never independently generated — when trace_ctx is present. This ensures a single source of truth for trace identity.

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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