pub enum PlanError {
Show 24 variants
UnknownDemand {
name: CapName,
roster: Vec<Name>,
workflow: Option<WorkflowName>,
},
UnknownPreference {
stage: StageName,
roster: Vec<Name>,
workflow: Option<WorkflowName>,
},
UnknownBackend {
backend: BackendName,
roster: Vec<Name>,
workflow: Option<WorkflowName>,
},
UnknownRule {
backend: BackendName,
rule: RuleName,
roster: Vec<Name>,
workflow: Option<WorkflowName>,
},
UnknownElement {
backend: BackendName,
element: ElementName,
workflow: Option<WorkflowName>,
},
RenderOption(OptionError),
NeedsUndeclared {
stage: StageName,
kind: &'static str,
name: Name,
roster: Vec<Name>,
workflow: Option<WorkflowName>,
},
NeedsTableType {
stage: StageName,
table: CapName,
declared: &'static str,
referenced: &'static str,
workflow: Option<WorkflowName>,
},
RegistryBoundRead {
error: OptionError,
workflow: Option<WorkflowName>,
},
RewriteReads {
stage: StageName,
table: CapName,
workflow: Option<WorkflowName>,
},
RewriteNeedsComputed {
stage: StageName,
capability: CapName,
provider: StageName,
workflow: Option<WorkflowName>,
},
CollectionRequired {
stage: StageName,
collection: CapName,
workflow: Option<WorkflowName>,
},
SelfExclusion {
stage: StageName,
requires: CapName,
provides: CapName,
workflow: Option<WorkflowName>,
},
Unsatisfiable {
capability: CapName,
blocked: Vec<Excluded>,
unprovided: Option<String>,
workflow: Option<WorkflowName>,
},
Contested {
capability: CapName,
candidates: Vec<StageName>,
workflow: Option<WorkflowName>,
},
RuleContest {
backend: BackendName,
element: ElementName,
candidates: Vec<RuleName>,
workflow: Option<WorkflowName>,
},
Cycle {
stages: Vec<StageName>,
workflow: Option<WorkflowName>,
},
TwoWriters {
table: CapName,
stages: Vec<StageName>,
workflow: Option<WorkflowName>,
},
RewriteTie {
active: Vec<StageName>,
first: StageName,
second: StageName,
resolving: Vec<OrderingDef>,
workflow: Option<WorkflowName>,
},
IoProductReadByPure {
reader: StageName,
io_stage: StageName,
workflow: Option<WorkflowName>,
},
ProducesCycle {
backend: BackendName,
cycle: Vec<ElementName>,
workflow: Option<WorkflowName>,
},
Incomplete {
backend: BackendName,
missing: Vec<ElementName>,
workflow: Option<WorkflowName>,
},
UnknownWorkflow {
workflow: WorkflowName,
roster: Vec<Name>,
},
UnknownOutput {
workflow: WorkflowName,
output: OutputName,
roster: Vec<Name>,
},
}Expand description
The reason a plan could not be built, returned by Plan::build,
Plan::for_workflow and workflow_request.
Every variant holds the names of the stages, capabilities, elements or other
entities involved. A variant about a name that is not declared also holds the
list of the declared names of that kind, except UnknownElement, so that its
message can list the alternatives. The Display text is a message for a person; match on the
variant to act on the error. The module documentation gives the order
in which the checks run.
Every variant that Plan::build returns also holds the workflow the plan
request was made from (PlanRequest::workflow), and its message names
that workflow: as the subject of the sentence where the request asks for
something (“the plan request for workflow html demands …”; “the plan
request demands …” for a request built by hand), and as an opening “for
workflow html, “ where the sentence is about a stage, a backend or the
plan. The request of a workflow also holds the caller’s overrides, so the
subject is the request made for the workflow, not the workflow itself.
RenderOption carries the name inside its OptionError.
UnknownWorkflow and UnknownOutput hold the name of the workflow they
are about.
Variants§
UnknownDemand
A demanded name is neither a declared capability nor a declared collection.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
UnknownPreference
A preferred stage is not registered.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
UnknownBackend
The plan request refers to a backend that is not registered, in its lowering selections or in its accepted unrenderable elements.
Fields
backend: BackendNameThe backend name written in the plan request.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
UnknownRule
A preferred lowering rule is not registered.
Fields
backend: BackendNameThe backend the preference was written for.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
UnknownElement
An element the plan request accepts as unrenderable is not registered.
Fields
backend: BackendNameThe backend on which the element is accepted as unrenderable.
element: ElementNameThe element name written in the plan request.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
RenderOption(OptionError)
The plan request sets an option value that the render request may not
set: the option type is not declared, or its binding does not admit the
render request (Bind). The option error
holds the workflow the request was made from, if any.
NeedsUndeclared
A stage needs a capability, a table or an option type that no feature declares.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
NeedsTableType
A stage reads a table as a different value type than the one the table is declared to hold.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
RegistryBoundRead
A stage declares a read of an option type whose value is fixed when the
registry is built (Bind::Registry).
No stage may read such an option type: the feature that owns it holds the
value in its configuration, and a read could only return the type’s
default.
Fields
error: OptionErrorThe option error, an OptionError::RegistryBoundRead.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
RewriteReads
A rewrite stage declares that it reads a table. A rewrite stage may not read tables: it runs before any table is computed.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
RewriteNeedsComputed
A rewrite stage requires the capability of a table that a scheduled stage other than a rewrite stage provides. Such a stage runs after every rewrite stage, so the rewrite stage would wait for data computed after it.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
CollectionRequired
A stage requires a collection. A collection is a name for a set of
capabilities (CollectionDef); a
plan request may demand one, but a stage may not require one.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
SelfExclusion
A stage requires a capability that scheduling the stage itself would rule out.
Scheduling a stage rules out every other stage that provides any of the same capabilities, including the capabilities that what it provides refines (refinement). Suppose a stage requires a capability that is related by refinement to one it provides: one refines the other, or both refine a common capability. Every provider of the required capability then provides that common capability too, so scheduling the stage would rule out every provider of what it requires. The check runs over every registered stage, scheduled or not. Requiring exactly a capability the stage itself declares as provided is allowed: the stage satisfies that requirement itself.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
Unsatisfiable
A needed capability has no provider left: no registered stage provides it, or provider selection ruled out every stage that provides it.
Fields
blocked: Vec<Excluded>Each stage that provides the capability, with the scheduled stage that ruled it out; empty when no registered stage provides the capability.
unprovided: Option<String>When no registered stage provides the capability, the text its
declaration gives for that case
(CapabilityDef::unprovided),
which the message gives in place of the generic one; None otherwise.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
Contested
A needed capability has several possible providers, and neither a preferred stage nor a default refinement chooses one of them. A default refinement is the refinement that a demand for its parent capability selects when nothing else decides (refinement).
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
RuleContest
Several lowering rules could lower one element on one backend, and
neither a preference nor a default mark
(DefaultMark) chooses one of them.
Fields
backend: BackendNameThe backend.
element: ElementNameThe element.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
Cycle
The scheduled stages depend on one another in a cycle.
Fields
stages: Vec<StageName>The cycle, in dependency order, starting at the stage whose name comes first and ending with that stage again.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
TwoWriters
Two scheduled stages write one table. At most one scheduled stage may write a table.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
RewriteTie
Two scheduled rewrite stages have no order relative to each other.
Each rewrite stage works on the trees the previous one produced, so the
rewrite stages of a plan need one total order. An ordering declaration
(OrderingDef) between two of them supplies it.
Fields
active: Vec<StageName>Every scheduled rewrite stage, in dependency order, with registration order breaking ties.
resolving: Vec<OrderingDef>Ordering declarations that would order the two; registering either one is enough.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
IoProductReadByPure
A stage whose effect is Compute or Check depends on a stage whose
effect is Effect::Io (a stage that acts outside the run’s computed
data, for example by writing files).
Every Io stage runs after every other stage, so only another Io stage
may depend on one.
Fields
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
ProducesCycle
The elements that the chosen lowering rules produce lead back to an element already on the path, so lowering would never finish.
Each lowering rule declares the elements it produces; lowering an element with its rule gives nodes of those elements, which are lowered in turn.
Fields
backend: BackendNameThe backend.
cycle: Vec<ElementName>The elements of the cycle, starting at the one whose name comes first; the rule of the last one produces the first.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
Incomplete
A backend that takes part in the plan cannot render every element a document may contain.
An element passes when the backend writes it natively (and the request does not prefer a lowering rule for it instead), or when the lowering rule chosen for it produces only elements that pass. Every element a document may contain must pass, except the elements the plan request accepts as unrenderable on that backend. An accepted element still does not pass when another element’s rule produces it.
Fields
backend: BackendNameThe backend.
missing: Vec<ElementName>The elements that do not pass.
workflow: Option<WorkflowName>The workflow the plan request was made from, or None for a request
built by hand (PlanRequest::workflow).
UnknownWorkflow
The requested workflow is not registered.
Fields
workflow: WorkflowNameThe requested workflow name.
UnknownOutput
A workflow lists an output that is not registered.
Trait Implementations§
Source§impl Error for PlanError
impl Error for PlanError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Forget for PlanError
impl Freeze for PlanError
impl Move for PlanError
impl RefUnwindSafe for PlanError
impl Send for PlanError
impl Sync for PlanError
impl Unpin for PlanError
impl UnsafeUnpin for PlanError
impl UnwindSafe for PlanError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more