pub enum BuilderError {
Io {
path: PathBuf,
error: Error,
},
Parse {
path: Option<PathBuf>,
source: String,
error: Error,
},
Deserialize {
path: Option<PathBuf>,
source: String,
error: FromTomlError,
},
Merge(BuilderMergeError),
}Expand description
Represents an error encountered while building a configuration.
Variants§
Io
Failed to read the provided configuration file.
Parse
Failed to parse the provided configuration file.
Fields
Deserialize
Failed to deserialize the provided configuration file.
Fields
error: FromTomlErrorThe error that was encountered.
Merge(BuilderMergeError)
Failed to merge configuration.
Implementations§
Source§impl BuilderError
impl BuilderError
Sourcepub fn path(&self) -> impl Display + Clone
pub fn path(&self) -> impl Display + Clone
Gets the path associated with the error.
If the error relates to parsing or deserializing an in-memory string,
the path will be <string>.
If the error relates to parsing or deserializing the merged
configuration, the path will be <merged>.
Sourcepub fn toml_error(&self) -> Option<&Error>
pub fn toml_error(&self) -> Option<&Error>
Gets the TOML error associated with the error.
Returns None if the error is not associated with parsing or
deserializing TOML.
Sourcepub fn source(&self) -> Option<&str>
pub fn source(&self) -> Option<&str>
Gets the TOML source code associated with the error.
Returns None if the error is not associated with parsing or
deserializing TOML.
Sourcepub fn to_diagnostic(&self) -> Diagnostic
pub fn to_diagnostic(&self) -> Diagnostic
Converts the error into a Diagnostic.
Trait Implementations§
Source§impl Debug for BuilderError
impl Debug for BuilderError
Source§impl Display for BuilderError
impl Display for BuilderError
Source§impl Error for BuilderError
impl Error for BuilderError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BuilderMergeError> for BuilderError
impl From<BuilderMergeError> for BuilderError
Source§fn from(source: BuilderMergeError) -> Self
fn from(source: BuilderMergeError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for BuilderError
impl !UnwindSafe for BuilderError
impl Freeze for BuilderError
impl Send for BuilderError
impl Sync for BuilderError
impl Unpin for BuilderError
impl UnsafeUnpin for BuilderError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more