Skip to main content

PlanError

Enum PlanError 

Source
pub enum PlanError {
    ConflictingVariableType {
        var: String,
        first_predicate: String,
        first_position: usize,
        first_type: ScalarType,
        second_predicate: String,
        second_position: usize,
        second_type: ScalarType,
    },
    InferenceConflict {
        predicate: String,
        column: usize,
        first_rule_index: usize,
        first_type: ScalarType,
        second_rule_index: usize,
        second_type: ScalarType,
    },
    RuleHeadPredicateMismatch {
        group_key: String,
        rule_index: usize,
        observed: String,
    },
}
Expand description

Hard errors from plan_rule / plan_rules / plan_scc_rules.

Distinct from RulePlan::BinaryFallback: a fallback verdict means the rule is plannable, just on a different path. A plan error means the rule cannot be planned at all under the current fixture and must be fixed by the caller.

Variants§

§

ConflictingVariableType

Same shape as RefEvalError::ConflictingVariableType. Mirrored here (rather than re-exporting the eval-error variant) so the planner’s error type is independent of the evaluator’s.

Fields

§var: String

Variable name as it appears in the source rule.

§first_predicate: String

Predicate of the first atom that typed var.

§first_position: usize

0-based argument position within first_predicate.

§first_type: ScalarType

Schema type at (first_predicate, first_position).

§second_predicate: String

Predicate of the conflicting atom.

§second_position: usize

0-based argument position within second_predicate.

§second_type: ScalarType

Schema type at (second_predicate, second_position).

§

InferenceConflict

Cross-rule head-column conflict detected during PR 8 SCC type inference. Two rules contributing to the same head predicate disagree on the type of the same column.

Mirrors RefEvalError::InferenceConflict so callers pattern-matching on plan errors can treat inference and eval conflicts symmetrically. Surfaced only by plan_scc_rules; per-rule plan_rule / plan_rules don’t run inference (no group context).

Fields

§predicate: String

Head predicate name where the conflict was detected.

§column: usize

0-based column index where types disagree.

§first_rule_index: usize

Rule index (within the predicate’s group) that first typed the column.

§first_type: ScalarType

Type derived from the first rule’s body.

§second_rule_index: usize

Rule index (within the predicate’s group) that disagrees.

§second_type: ScalarType

Type derived from the conflicting rule’s body.

§

RuleHeadPredicateMismatch

A rule grouped under predicate group_key heads a different predicate. Surfaces from plan_scc_rules only; per-rule plan_rule / plan_rules don’t have group context to validate against.

Mirrors super::SccFixpointError::RuleHeadPredicateMismatch so the planner and the SCC fixpoint evaluator agree on the diagnostic for this fixture class. Without symmetry, a caller driving plan-then-evaluate would see the planner say “MultiwayCandidate” while the evaluator says “RuleHeadPredicateMismatch” — the same disagreement pattern PR 9 closed for unsupported-key cases.

Fields

§group_key: String

BTreeMap key under which the rule was grouped.

§rule_index: usize

Index of the rule within that group.

§observed: String

Head predicate observed on the rule.

Trait Implementations§

Source§

impl Clone for PlanError

Source§

fn clone(&self) -> PlanError

Returns a duplicate of the value. Read more
1.0.0 · 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 PartialEq for PlanError

Source§

fn eq(&self, other: &PlanError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PlanError

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> 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<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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,