pub struct Plan {
pub version: u64,
pub planner_v: String,
pub effects: Vec<Effect>,
pub opset: PlanOpset,
pub preconditions: Preconditions,
pub new_ids: Vec<NewId>,
pub selection: Option<Selection>,
pub templates: Option<Vec<Value>>,
pub plan_id: String,
pub diagnostics: Vec<String>,
pub preview: Option<PlanPreview>,
}Expand description
§11.4 Plan.
Fields§
§version: u64§planner_v: String§effects: Vec<Effect>The effects with their targets resolved; $new.<n> kept symbolic;
dropped duplicates excluded.
opset: PlanOpset§preconditions: Preconditions§new_ids: Vec<NewId>§selection: Option<Selection>§11.8: present when the plan was derived from a selector (digested).
templates: Option<Vec<Value>>§11.8 “Sugar” (3.2): the effects as written when a selector-less
request carried a -> leader or an { oqx } directive that was
evaluated in its target’s row scope — outside the digest (a plain
request produces none, so no existing plan_id moves), on the wire,
and in the intent record as templates.
plan_id: String§diagnostics: Vec<String>§preview: Option<PlanPreview>Implementations§
Source§impl Plan
impl Plan
Sourcepub fn core_json(&self) -> Value
pub fn core_json(&self) -> Value
The executable core the digest covers: { version, planner_v, effects, opset, preconditions, new_ids, selection? } (selection
only when present, §11.8).
Sourcepub fn to_json(&self, with_preview: bool) -> Value
pub fn to_json(&self, with_preview: bool) -> Value
The wire form; preview only when present and with_preview.
Sourcepub fn from_json(v: &Value) -> Result<Plan, String>
pub fn from_json(v: &Value) -> Result<Plan, String>
Parse a well-formed plan (version must already be 1: use
Plan::admit for a client’s object).
Sourcepub fn admit(v: &Value) -> Result<Plan, Admission>
pub fn admit(v: &Value) -> Result<Plan, Admission>
§11.7 admission of a client’s plan object, in this order: version
≠ 1 → unsupported_plan_version (before any other member is read);
a missing or mistyped core member → invalid; the recomputed digest
≠ plan_id → plan_mismatch { expected, actual }.