Skip to main content

ModuleError

Enum ModuleError 

Source
#[non_exhaustive]
pub enum ModuleError {
Show 15 variants NotFound { path: Vec<String>, searched: Vec<PathBuf>, }, CircularImport { cycle: Vec<Vec<String>>, }, ImportConflict { name: String, module1: Vec<String>, module2: Vec<String>, }, PrivatePredicate { name: String, module: Vec<String>, }, PredicateNotFound { name: String, module: Vec<String>, }, UnsupportedImportedContent { module: Vec<String>, constructs: Vec<String>, }, HiddenDependency { module: Vec<String>, export: String, dependency: String, }, AmbiguousModulePath { path: Vec<String>, candidates: Vec<PathBuf>, }, IncompatiblePredicateDeclaration { name: String, module1: Vec<String>, module2: Vec<String>, }, IncompatibleDomainDeclaration { name: String, module1: Vec<String>, module2: Vec<String>, }, DuplicateImportedFunction { name: String, module: Vec<String>, }, ConflictingPredicateVisibility { name: String, module: Vec<String>, }, IncompatibleInferredPredicateSchema { name: String, arity: usize, column: usize, type1: ScalarType, type2: ScalarType, module1: Vec<String>, module2: Vec<String>, source1: Box<PathBuf>, source2: Box<PathBuf>, }, PredicateSchemaInferenceFailed { name: String, arity: usize, module: Vec<String>, source: Box<PathBuf>, message: String, }, ParseError { path: PathBuf, message: String, },
}
Expand description

Errors that can occur during module resolution

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotFound

Module file not found

Fields

§path: Vec<String>

Logical module path that failed to resolve.

§searched: Vec<PathBuf>

Filesystem locations that were searched.

§

CircularImport

Circular import detected

Fields

§cycle: Vec<Vec<String>>

Ordered import cycle that was discovered.

§

ImportConflict

Conflicting definitions for an imported function.

Fields

§name: String

Function name that has multiple definitions.

§module1: Vec<String>

Module containing the first definition.

§module2: Vec<String>

Module containing the conflicting definition.

§

PrivatePredicate

Attempted to import private predicate

Fields

§name: String

Predicate name that is not exported.

§module: Vec<String>

Module that owns the private predicate.

§

PredicateNotFound

Selected item not exported by a module

Fields

§name: String

Predicate or function name that is not exported.

§module: Vec<String>

Module that was expected to export the item.

§

UnsupportedImportedContent

An imported module contains program-level constructs that are entry-only.

Fields

§module: Vec<String>

Module containing the unsupported constructs.

§constructs: Vec<String>

Deterministically ordered construct categories.

§

HiddenDependency

An exported item depends on module-local support that the import filters out.

Fields

§module: Vec<String>

Module containing the exported item.

§export: String

Exported predicate or function whose implementation is incomplete.

§dependency: String

Private or selectively omitted dependency.

§

AmbiguousModulePath

A context-free API request used a logical path that names several loaded files.

Fields

§path: Vec<String>

Logical module path whose source cannot be inferred.

§candidates: Vec<PathBuf>

Canonical source files registered for the logical path.

§

IncompatiblePredicateDeclaration

A declaration in the entry program or a selected public declaration in its resolved imports conflicts with another participating declaration.

Fields

§name: String

Predicate whose declarations differ.

§module1: Vec<String>

Module containing the first declaration.

§module2: Vec<String>

Module containing the incompatible declaration.

§

IncompatibleDomainDeclaration

The entry program or imported modules define one domain alias with incompatible scalar types.

Fields

§name: String

Domain alias whose declarations differ.

§module1: Vec<String>

Module containing the first declaration.

§module2: Vec<String>

Module containing the incompatible declaration.

§

DuplicateImportedFunction

An imported module defines one exported function name more than once.

Fields

§name: String

Duplicate function name.

§module: Vec<String>

Module containing the duplicate definitions.

§

ConflictingPredicateVisibility

An imported module declares one predicate as both public and private.

Fields

§name: String

Predicate with contradictory visibility declarations.

§module: Vec<String>

Module containing the declarations.

§

IncompatibleInferredPredicateSchema

Separate source programs contribute clauses for one undeclared predicate signature with incompatible inferred column types.

Fields

§name: String

Predicate whose inferred schemas differ.

§arity: usize

Predicate arity used to distinguish same-name signatures.

§column: usize

One-based index of the incompatible column.

§type1: ScalarType

Type inferred from the first contribution.

§type2: ScalarType

Type inferred from the conflicting contribution.

§module1: Vec<String>

Module containing the first contribution.

§module2: Vec<String>

Module containing the conflicting contribution.

§source1: Box<PathBuf>

Source identity for the first contribution, or <program> when no loaded source anchors the caller’s program.

§source2: Box<PathBuf>

Source identity for the conflicting contribution, or <program> when no loaded source anchors the caller’s program.

§

PredicateSchemaInferenceFailed

A clause contains invalid type evidence while module resolution is inferring an undeclared predicate signature.

Fields

§name: String

Predicate whose contribution could not be inferred.

§arity: usize

Predicate arity used to identify the signature.

§module: Vec<String>

Module containing the invalid contribution.

§source: Box<PathBuf>

Source containing the invalid contribution.

§message: String

Diagnostic produced by the authoritative schema inference path.

§

ParseError

Parse error in module

Fields

§path: PathBuf

Source file path that failed to parse.

§message: String

Human-readable parse failure message.

Trait Implementations§

Source§

impl Clone for ModuleError

Source§

fn clone(&self) -> ModuleError

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 ModuleError

Source§

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

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

impl Display for ModuleError

Source§

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

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

impl Error for ModuleError

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

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

impl From<ModuleError> for XlogError

Source§

fn from(e: ModuleError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

§

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

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