Skip to main content

LoadError

Enum LoadError 

Source
pub enum LoadError {
Show 27 variants Io { path: PathBuf, source: Error, }, Parse { path: PathBuf, source: ParseFileError, }, UnresolvedRequire { name: String, searched: Vec<PathBuf>, }, UnresolvedImport { name: String, from: PathBuf, searched: Vec<PathBuf>, }, Cycle { chain: Vec<PathBuf>, }, DocumentAsDependency { path: PathBuf, }, LibraryAsEntry { path: PathBuf, }, UnsupportedVersion { requested: RustyfiVersion, supported: Vec<RustyfiVersion>, }, InvalidModeVersion { version: RustyfiVersion, }, SourceProviderUnderEnvelopes, PackageDependencyUnresolved { module: String, from: PathBuf, }, BareUseOutsidePackage { module: String, from: PathBuf, }, UnresolvedUseOf { relpath: String, from: PathBuf, searched: Vec<PathBuf>, }, EnvelopeHeaderUnderLegacy { header: String, from: PathBuf, }, LegacyHeaderUnderEnvelopes { header: String, from: PathBuf, }, DepsConfigNotFound { path: PathBuf, source: Error, }, DepsConfigDecode { path: PathBuf, message: String, }, EnvelopeConfigNotFound { path: PathBuf, source: Error, }, EnvelopeConfigDecode { path: PathBuf, message: String, }, CannotReadDirectory { path: PathBuf, source: Error, }, EnvelopeNameConflict { name: String, }, DependencyOnUnknownEnvelope { depending: String, depended: String, }, CyclicEnvelopeDependency { chain: Vec<String>, }, FileModuleNameConflict { module: String, prev: PathBuf, path: PathBuf, }, FileModuleNotFound { module: String, from: PathBuf, }, UseOfInsidePackage { module: String, from: PathBuf, }, UnknownPackageDependency { module: String, from: PathBuf, },
}
Expand description

Everything that can go wrong while loading a multi-file SATySFi program.

Variants§

§

Io

Could not read a source file from disk.

Fields

§path: PathBuf
§source: Error
§

Parse

A file failed to parse (lex or grammar error). source carries the original ParseFileError (span + message) unchanged.

Fields

§path: PathBuf
§

UnresolvedRequire

@require: name could not be resolved to any file on disk.

Fields

§name: String
§searched: Vec<PathBuf>
§

UnresolvedImport

@import: name could not be resolved to any file on disk.

Fields

§name: String
§from: PathBuf
§searched: Vec<PathBuf>
§

Cycle

The dependency graph contains a cycle; chain names the files involved, in traversal order, with the first file repeated at the end to make the loop explicit (e.g. [a, b, a]).

Fields

§chain: Vec<PathBuf>
§

DocumentAsDependency

A file reached via @require:/@import: is a document (has a body) rather than a library.

Fields

§path: PathBuf
§

LibraryAsEntry

The entry file is a library (no body) rather than a document.

Fields

§path: PathBuf
§

UnsupportedVersion

opts.version names a SATySFi version this port does not implement yet (checked before any file is even read).

Fields

§requested: RustyfiVersion
§supported: Vec<RustyfiVersion>
§

InvalidModeVersion

LoadMode::Envelopes was requested for a version with no use headers — the rejected combination. Checked before any file is read.

Fields

§

SourceProviderUnderEnvelopes

A crate::SourceProvider was supplied alongside LoadMode::Envelopes. The Envelopes backend reads its deps/envelope configs through std::fs directly, so honouring the provider for some reads and not others would assemble a dependency graph half out of memory and half off the disk.

§

PackageDependencyUnresolved

use package Mod with no deps config to resolve Mod against (upstream’s used_as map is empty).

Fields

§module: String
§from: PathBuf
§

BareUseOutsidePackage

Bare use Mod at document/open level (upstream CannotUseHeaderUse): a document cannot reach into a package’s internals by module name. Permanent (not a stub): the closed resolver handles bare use only inside envelope source trees.

Fields

§module: String
§from: PathBuf
§

UnresolvedUseOf

use … of `relpath` matched no candidate file on disk.

Fields

§relpath: String
§from: PathBuf
§searched: Vec<PathBuf>
§

EnvelopeHeaderUnderLegacy

A use-family header under Legacy mode (the mode that resolves @require:/@import:). Names the fix.

Fields

§header: String
§from: PathBuf
§

LegacyHeaderUnderEnvelopes

A Legacy (@require:/@import:) header under Envelopes mode. Names the fix.

Fields

§header: String
§from: PathBuf
§

DepsConfigNotFound

The --deps file (rustyfi-deps.yaml) could not be read. Upstream DepsConfigNotFound, depsConfig.ml:40-45.

Fields

§path: PathBuf
§source: Error
§

DepsConfigDecode

rustyfi-deps.yaml failed to decode or validate — either a YAML/shape error from serde_yaml or one of the two non-structural checks (path must be absolute; used_as must be an uppercased identifier). Upstream DepsConfigError wrapping YamlError (depsConfig.ml:46-47, yamlDecoder.ml); message carries a dotted-path context string in the same spirit as upstream’s show_yaml_context (wording is this port’s own).

Fields

§path: PathBuf
§message: String
§

EnvelopeConfigNotFound

A rustyfi-envelope.yaml could not be read. Upstream EnvelopeConfigNotFound, envelopeConfig.ml:142-147.

Fields

§path: PathBuf
§source: Error
§

EnvelopeConfigDecode

A rustyfi-envelope.yaml failed to decode or validate. Upstream EnvelopeConfigError. Covers the library/font branch check, opentype_single/opentype_collection branch check, relative path, lowercased font name, and the 18 markdown_conversion command/identifier shapes.

Fields

§path: PathBuf
§message: String
§

CannotReadDirectory

A source_directories entry of an envelope could not be listed. Upstream CannotReadDirectory, envelopeReader.ml:15-16.

Fields

§path: PathBuf
§source: Error
§

EnvelopeNameConflict

Two deps-config envelopes share a name. Upstream EnvelopeNameConflict, closedEnvelopeDependencyResolver.ml:50-51.

Fields

§name: String
§

DependencyOnUnknownEnvelope

An envelope depends on a name absent from the deps config’s envelope set. Upstream DependencyOnUnknownEnvelope, closedEnvelopeDependencyResolver.ml:71-76.

Fields

§depending: String
§depended: String
§

CyclicEnvelopeDependency

A cycle in the envelope dependency graph. Upstream CyclicEnvelopeDependency; chain is names (not paths), the first element repeated last, matching LoadError::Cycle’s shape.

Fields

§chain: Vec<String>
§

FileModuleNameConflict

Two source files in one envelope declare the same module name. Upstream FileModuleNameConflict, closedFileDependencyResolver.ml:20-22.

Fields

§module: String
§prev: PathBuf
§path: PathBuf
§

FileModuleNotFound

A bare use M inside an envelope names no sibling module. Upstream FileModuleNotFound, closedFileDependencyResolver.ml:37-41.

Fields

§module: String
§from: PathBuf
§

UseOfInsidePackage

A use … of header inside an envelope source tree. Upstream CannotUseHeaderUseOf, closedFileDependencyResolver.ml:51-52.

Fields

§module: String
§from: PathBuf
§

UnknownPackageDependency

A use package M header whose head matches no used_as alias in the supplied deps config. Upstream UnknownPackageDependency (typecheck-side there, load-side here — this port’s loader is the only header consumer).

Fields

§module: String
§from: PathBuf

Trait Implementations§

Source§

impl Debug for LoadError

Source§

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

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

impl Display for LoadError

Source§

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

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

impl Error for LoadError

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

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> Debug for T
where T: Debug,

Source§

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

Source§

impl<T> Display for T
where T: Display,

Source§

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

Source§

impl<T> Error for T
where T: Error,

Source§

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

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