Skip to main content

Module policy

Module policy 

Source
Expand description

Policy: what the runtime may do on its own.

Two parts:

  • Capabilities::unknown_plan, the rule that keeps the runtime from turning “I don’t know” into a duplicate side effect;
  • RiskPolicy, which adds requirements by risk level and effect kind: approval, verification, no automatic retries.

Both are pure, so they can be tested exhaustively.

Structs§

Capabilities
The properties of an effect that decide how its unknown outcomes are resolved.
PolicyBuilder
Builds a RiskPolicy: start a rule with for_risk, for_kind or for_risk_and_kind, then add requirements to it.
Requirements
What a policy demands of an effect. Requirements only ever accumulate.
RiskPolicy
Requirements by risk level and effect kind, applied to every effect the runtime runs. Built with PolicyBuilder; set with RuntimeBuilder::risk_policy.

Enums§

RiskLevel
How much damage an effect could do if it went wrong. Set with EffectBuilder::risk or EffectHandler::risk; defaults to Low.
UnknownPlan
What to do with an effect whose last attempt has an unknown outcome.