#[non_exhaustive]pub struct RunOptions<'a> {Show 13 fields
pub channel: Option<&'a str>,
pub routing_bucket: Option<u8>,
pub capture_changes: bool,
pub audit: AuditMode,
pub deadline: Option<Instant>,
pub cancel: Option<&'a CancelToken>,
pub layers: &'a [Arc<dyn CallLayer>],
pub observer: Option<&'a dyn Observer>,
pub trace: Option<TraceOptions>,
pub condition_error_policy: Option<ConditionErrorPolicy>,
pub task_budget: Option<u64>,
pub expr_ops_budget: Option<u64>,
pub accountant: Option<&'a dyn RunAccountant>,
}Expand description
What a caller chooses about one run.
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.channel: Option<&'a str>Run the Active workflows of this channel; None runs every Active one.
routing_bucket: Option<u8>The bucket a rollout admits, 0..=99; a larger one is served as 99.
None is admitted by every rollout.
capture_changes: boolRecord each write’s Change in its task’s audit entry. true by
default (#63). It governs only the audit trail: a trace records its
own changes whatever it says.
audit: AuditModeWhich audit entries the message keeps. Full by default.
deadline: Option<Instant>When the run must end; None by default. It is checked at every
host call, every fan-out element’s start, every sweep and every
CHECK_EVERY ops. Natively each host call also races it, on a Tokio timer, so a
run with a deadline is polled inside a Tokio runtime with its time
driver enabled. A call it cuts short, or that returns Err once it
has passed, is recorded as TIMEOUT_ERROR on its task; either way
the run ends TimedOut.
On wasm no timer exists, so nothing races a host call and it is never cut short mid-flight: a deadline that passes while a call runs is seen at the next check, after the call returns.
cancel: Option<&'a CancelToken>A token that cancels the run when it, or an ancestor, is cancelled;
None by default. It is checked and raced where the deadline is,
and first. A call it cuts short, or that returns Err once it is
cancelled, is recorded as CANCELLED on its task; either way the
run ends Cancelled.
layers: &'a [Arc<dyn CallLayer>]Layers around every host call of this run, outside the registry’s; the first is the outermost. None by default.
observer: Option<&'a dyn Observer>An observer of this run, beside the engine’s
(EngineConfig::observer); None by default.
trace: Option<TraceOptions>Trace the run, as these options say: its Run::trace is then the
initial context plus each step’s changes. None by default: no
trace, and no copy of the context.
condition_error_policy: Option<ConditionErrorPolicy>How condition evaluation errors are handled during this run; None
inherits the engine’s EngineConfig::condition_error_policy
(which defaults to ConditionErrorPolicy::Skip).
task_budget: Option<u64>Maximum number of task dispatches (inline built-ins, host calls, loop
sweeps, and for_each elements) permitted during this run; None by
default.
expr_ops_budget: Option<u64>Maximum cumulative datalogic operations permitted across all
expressions evaluated during this run; None by default.
accountant: Option<&'a dyn RunAccountant>Host-owned accounting and admission hook for this run; None by
default.
Implementations§
Source§impl<'a> RunOptions<'a>
impl<'a> RunOptions<'a>
Sourcepub fn routing_bucket(self, b: u8) -> Self
pub fn routing_bucket(self, b: u8) -> Self
Sets the routing bucket rollouts are tested against: 0..=99. A
larger one is served as bucket 99, as in 3.x, so derive it as a
hash % 100, never % 256.
Sourcepub fn capture_changes(self, on: bool) -> Self
pub fn capture_changes(self, on: bool) -> Self
Turns the audit trail’s change capture on or off.
Sourcepub fn deadline(self, deadline: Instant) -> Self
pub fn deadline(self, deadline: Instant) -> Self
Ends the run at deadline, as the deadline field says.
Sourcepub fn cancel(self, token: &'a CancelToken) -> Self
pub fn cancel(self, token: &'a CancelToken) -> Self
Cancels the run when token is cancelled, as the cancel field
says.
Sourcepub fn layers(self, layers: &'a [Arc<dyn CallLayer>]) -> Self
pub fn layers(self, layers: &'a [Arc<dyn CallLayer>]) -> Self
Wraps every host call of the run in layers, outside the registry’s
layers; the first is the outermost.
Sourcepub fn observer(self, o: &'a dyn Observer) -> Self
pub fn observer(self, o: &'a dyn Observer) -> Self
Reports this run to o too, beside the engine’s observer.
Sourcepub fn trace(self, opts: TraceOptions) -> Self
pub fn trace(self, opts: TraceOptions) -> Self
Traces the run under opts, as the trace field says.
Sourcepub fn condition_error_policy(self, policy: ConditionErrorPolicy) -> Self
pub fn condition_error_policy(self, policy: ConditionErrorPolicy) -> Self
Sets how condition evaluation errors are handled during this run.
Sourcepub fn with_condition_error_policy(self, policy: ConditionErrorPolicy) -> Self
pub fn with_condition_error_policy(self, policy: ConditionErrorPolicy) -> Self
Alias for Self::condition_error_policy.
Sourcepub fn task_budget(self, max_tasks: u64) -> Self
pub fn task_budget(self, max_tasks: u64) -> Self
Sets the maximum number of task dispatches permitted during this run.
Sourcepub fn with_task_budget(self, max_tasks: u64) -> Self
pub fn with_task_budget(self, max_tasks: u64) -> Self
Alias for Self::task_budget.
Sourcepub fn expr_ops_budget(self, max_ops: u64) -> Self
pub fn expr_ops_budget(self, max_ops: u64) -> Self
Sets the maximum cumulative datalogic operations permitted across all expressions evaluated during this run.
Sourcepub fn with_expr_ops_budget(self, max_ops: u64) -> Self
pub fn with_expr_ops_budget(self, max_ops: u64) -> Self
Alias for Self::expr_ops_budget.
Sourcepub fn accountant(self, accountant: &'a dyn RunAccountant) -> Self
pub fn accountant(self, accountant: &'a dyn RunAccountant) -> Self
Attaches a host-owned RunAccountant to this run.
Sourcepub fn with_accountant(self, accountant: &'a dyn RunAccountant) -> Self
pub fn with_accountant(self, accountant: &'a dyn RunAccountant) -> Self
Alias for Self::accountant.