Skip to main content

PlanError

Enum PlanError 

Source
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

§name: CapName

The demanded name.

§roster: Vec<Name>

Every declared capability and collection, in name order.

§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

§stage: StageName

The preferred stage name.

§roster: Vec<Name>

Every registered stage, in name order.

§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: BackendName

The backend name written in the plan request.

§roster: Vec<Name>

Every registered backend, in name order.

§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: BackendName

The backend the preference was written for.

§rule: RuleName

The preferred rule name.

§roster: Vec<Name>

Every registered rule, in name order.

§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: BackendName

The backend on which the element is accepted as unrenderable.

§element: ElementName

The 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

§stage: StageName

The stage.

§kind: &'static str

The kind of the undeclared thing: capability, table or option type.

§name: Name

The undeclared name the stage needs.

§roster: Vec<Name>

Every declared name of that kind, in name order.

§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

§stage: StageName

The stage.

§table: CapName

The table.

§declared: &'static str

The value type the table is declared to hold.

§referenced: &'static str

The value type the stage’s read expects.

§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: OptionError

The 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

§stage: StageName

The rewrite stage.

§table: CapName

The table it declared it reads.

§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

§stage: StageName

The rewrite stage.

§capability: CapName

The capability it requires.

§provider: StageName

The scheduled stage that provides that capability.

§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

§stage: StageName

The stage.

§collection: CapName

The collection it requires.

§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

§stage: StageName

The stage.

§requires: CapName

The capability it requires.

§provides: CapName

The capability it provides that is related by refinement to the required one.

§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

§capability: CapName

The capability.

§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

§capability: CapName

The capability.

§candidates: Vec<StageName>

The stages that could provide it, in name order.

§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: BackendName

The backend.

§element: ElementName

The element.

§candidates: Vec<RuleName>

The rules that could lower it, in name order.

§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

§table: CapName

The table.

§stages: Vec<StageName>

The two stages, in registration order.

§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.

§first: StageName

One of the two unordered rewrites.

§second: StageName

The other one.

§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

§reader: StageName

The Compute or Check stage.

§io_stage: StageName

The Io stage it depends on.

§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: BackendName

The 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: BackendName

The 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: WorkflowName

The requested workflow name.

§roster: Vec<Name>

Every registered workflow, in name order.

§

UnknownOutput

A workflow lists an output that is not registered.

Fields

§workflow: WorkflowName

The workflow listing it.

§output: OutputName

The output it lists.

§roster: Vec<Name>

Every registered output, in name order.

Trait Implementations§

Source§

impl Clone for PlanError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlanError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PlanError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for PlanError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.