pub struct ExecCtxBuilder { /* private fields */ }Expand description
Builder for ExecCtx.
Implementations§
Source§impl ExecCtxBuilder
impl ExecCtxBuilder
Sourcepub fn client(self, client: Client) -> Self
pub fn client(self, client: Client) -> Self
Set the HTTP client. If not set, a default client is created.
Sourcepub fn backend(self, backend: Arc<dyn Backend>) -> Self
pub fn backend(self, backend: Arc<dyn Backend>) -> Self
Set the LLM backend. Default: OllamaBackend.
Sourcepub fn backoff(self, config: BackoffConfig) -> Self
pub fn backoff(self, config: BackoffConfig) -> Self
Set the transport retry configuration. Default: BackoffConfig::none().
Sourcepub fn var(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn var(self, key: impl Into<String>, value: impl Into<String>) -> Self
Insert a single template variable.
Sourcepub fn cancellation(self, cancel: Option<Arc<AtomicBool>>) -> Self
pub fn cancellation(self, cancel: Option<Arc<AtomicBool>>) -> Self
Set the cancellation flag.
Sourcepub fn event_handler(self, handler: Arc<dyn EventHandler>) -> Self
pub fn event_handler(self, handler: Arc<dyn EventHandler>) -> Self
Set the event handler.
Sourcepub fn timeout(self, timeout: Duration) -> Self
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).
Sourcepub 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.
pub fn with_trace_id(self, trace_id: TraceId) -> Self
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.
Sourcepub fn with_trace_ctx(self, trace_ctx: TraceCtx) -> Self
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.
Sourcepub fn with_limits(self, limits: PipelineLimits) -> Self
pub fn with_limits(self, limits: PipelineLimits) -> Self
Set resource limits. If not set, PipelineLimits::default() is used.
Sourcepub fn build(self) -> ExecCtx
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:
- (Canonical) If
trace_ctxwas set explicitly viawith_trace_ctx(), use it. Derive legacytrace_idfrom it at the compatibility boundary. - (Legacy/compat) If only
trace_idwas set via deprecatedwith_trace_id(), derivetrace_ctxfrom it. - (Default) If neither was set, generate a fresh
TraceCtxand derive legacytrace_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.