Skip to main content

LoadError

Enum LoadError 

Source
pub enum LoadError {
    Io(Error),
    Discover(DiscoverError),
    Config {
        path: String,
        source: Box<ConfigError>,
    },
    ConfigRead {
        path: String,
        source: Error,
    },
    InvalidSourceKey(String),
}
Expand description

A failure producing an Environment from a mount.

Variants§

§

Io(Error)

An I/O error reading or enumerating the tree.

§

Discover(DiscoverError)

INCLUDE discovery failed (missing include, circular include).

§

Config

A discovered brink.toml could not be parsed (malformed TOML, or a recognized key with an out-of-range value). Unknown keys are warnings, never this error. Carries the discovered path so the message names which file failed — lost when this variant went through a bare #[from] ConfigError in #1306 (#1369 restores it). source is itself now path-carrying too (#1384: parse_str_at threads path into every ConfigError it raises), so this field is kept for structural/pattern-matching access (existing callers destructure LoadError::Config { path, .. }) rather than duplicated into the rendered message — source’s own Display already names the file. source is boxed: ConfigError grew past clippy::result_large_err’s threshold once #1384 threaded path into its own variants, and this is the one LoadError variant that stacks a second path field on top of it.

Fields

§path: String

The root-relative key of the brink.toml that failed to parse.

§

ConfigRead

A discovered brink.toml could not be read (permission error, non-UTF-8 bytes, or any other I/O failure) — the other half of #1369’s regression: tree.read(&config_key)? used to fall through the bare #[from] io::Error on LoadError::Io, which carries no path (RealFs::read is fs::read_to_string, and std I/O errors don’t carry the path that failed). Carries the discovered path so this half names the file too.

Fields

§path: String

The root-relative key of the brink.toml that failed to read.

§source: Error
§

InvalidSourceKey(String)

A native source key is not root-relative (contains a .. segment) — a save-key-identity guardrail against a SourceTree that violates the contract.

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

impl From<DiscoverError> for LoadError

Source§

fn from(source: DiscoverError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for LoadError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Lookup<T> for T

Source§

fn into_owned(self) -> T

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more