#[non_exhaustive]pub enum Error {
Show 15 variants
TypeMismatch {
expected: TypeId,
found: TypeId,
sites: Vec<ErrorSite>,
},
InvalidId,
Conflict {
sites: Vec<ErrorSite>,
},
Cycle {
sites: Vec<ErrorSite>,
},
SeedCycle {
sites: Vec<ErrorSite>,
},
MethodFailed {
error: Error,
sites: Vec<ErrorSite>,
},
InvalidMethod {
sites: Vec<ErrorSite>,
},
MismatchedMethodCells {
sites: Vec<ErrorSite>,
},
InvalidMethodOutputs {
sites: Vec<ErrorSite>,
},
InvalidConditional {
sites: Vec<ErrorSite>,
},
InvalidOutput,
InvalidCellKind {
sites: Vec<ErrorSite>,
},
InvalidFilter,
InvalidRequirement,
DependencyCycle {
sites: Vec<ErrorSite>,
},
}Expand description
Errors returned by Sheet operations and propagation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TypeMismatch
A value’s TypeId did not match the cell’s registered TypeId.
expected: the TypeId registered when the cell was created.found: the TypeId of the value or declaration supplied by the caller.
Fields
InvalidId
A CellId or RelationshipId was not found in the sheet.
Conflict
No valid method assignment exists, or staged prerequisite provenance conflicts with the final selected plan.
Fields
Cycle
The selected methods form a cycle.
Fields
SeedCycle
The seed dependency graph contains a non-self cycle.
Fields
MethodFailed
A method’s function returned an error during execution.
Fields
InvalidMethod
A method is structurally invalid (e.g. the outputs list is empty, a relationship’s methods reference different sets of cells, or two methods in a relationship share an identical output set). A method with no inputs is not an error: it defines a fixed point (a constant) rather than a derivation.
Fields
MismatchedMethodCells
Two methods in the same relationship have inputs ∪ outputs sets that don’t
match. Every method in a relationship must reference exactly the same set of
cells.
Fields
sites: Vec<ErrorSite>sites[0] is the first method (by index within the Vec passed to
add_relationship) whose cell set diverges from method 0’s; sites[1] is
always MethodIndex(0), the baseline every other method’s cell set is
compared against; further entries are the cells in the symmetric
difference of the two methods’ cell sets.
InvalidMethodOutputs
A method’s own outputs list names a cell more than once, or two methods in
the same relationship have identical or nested outputs sets. Overlapping
output sets are allowed when neither set nests the other.
Fields
sites: Vec<ErrorSite>sites[0] is the method (by index within the Vec passed to
add_relationship) whose output set collided. For a method’s own outputs
repeating a cell, further entries are the repeated cell(s). For two methods
with identical or nested output sets, sites[1] is the earlier method’s
index and further entries are the duplicate or nested subset cell(s).
InvalidConditional
A conditional is structurally invalid: the cell was not found, a referenced relationship was not found, a relationship appears in more than one conditional branch, a branch key’s type does not match the cell’s registered type, or a branch has no keys.
Fields
InvalidOutput
An add_out call is structurally invalid: the writer method does not have
exactly one output cell.
InvalidCellKind
A relationship or conditional attempted to claim a Source-kind cell as a
method’s output, write() targeted an Out-kind cell, or add_out targeted a
cell that is already Source/Out kind or already claimed as another method’s
output.
Fields
InvalidFilter
An add_filter call is structurally invalid: the cell already has a filter,
the filter’s own value type does not match the cell’s registered type, or the
filter’s own argument list names cell itself. (An unknown cell or an
argument-cell type mismatch use the shared InvalidId/TypeMismatch variants
instead — add_filter has no cell-kind restriction, so it never returns
InvalidCellKind.)
InvalidRequirement
An add_requirement call has an invalid input signature, or (on a
Cell/Source kind cell)
evaluating the requirement against current values returns Ok(false).
DependencyCycle
A filter’s argument, or a conditional’s match subject, depends on a cell that
filter or conditional governs, in the sheet’s static dependency graph: every
method’s input → output edges (a self-referencing input adds none), each
filter’s argument → filtered guard edges, and each conditional’s
match cell → output guard edges for every method output of its branch and
default relationships. Returned by Sheet::validate and by Sheet::propagate,
which validates before mutating propagation state.
Implementations§
Source§impl Error
impl Error
Sourcepub fn sites(&self) -> &[ErrorSite]
pub fn sites(&self) -> &[ErrorSite]
The source components this error implicates, primary first.
sites[0] is the primary culprit; further entries are ordered related context
(for a cycle, the remaining members in loop order). Empty for variants that never
track a site, or when none applies to this occurrence.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the underlying anyhow::Error source for MethodFailed.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()