Struct miau::error::ConfigurationError [−][src]
Represents all errors that might occur at all stages of processing configuration.
Implementations
impl ConfigurationError
[src]
pub fn inner(&self) -> &ErrorCode
[src]
Returns reference to underlying error code. Returned object has all contextual information stripped off.
pub fn enrich_with_context<T: Display>(self, message: T) -> Self
[src]
Enriches error context with arbitray message.
Used to put more contextual information in the error to facilitate debugging issues. One can put e.g. path to file that failed to open in error message this way.
Example
use miau::error::{ConfigurationError, ErrorCode}; let error: ConfigurationError = ErrorCode::NullValue.into(); let enriched_error = error .enrich_with_context("Detailed description of contextual information");
pub fn enrich_with_key(self, key: Key) -> Self
[src]
Enriches error context with a key.
Used to put more contextual information in the error to facilitate debugging issues. One can put information about location in configuration tree in error with this function.
Example
use miau::error::{ConfigurationError, ErrorCode}; use miau::configuration::Key; let error: ConfigurationError = ErrorCode::NullValue.into(); let enriched_error = error .enrich_with_key(Key::Map("key".to_string()));
pub fn enrich_with_keys(self, keys: &CompoundKey) -> Self
[src]
Enriches error context with a complex path.
Used to put more contextual information in the error to facilitate debugging issues. One can put information about location in configuration tree in error with this function.
pub fn pretty_display(&self) -> PrettyConfigurationDisplay<'_>
[src]
Returns an object that displays error in pretty way.
Example
use miau::error::{ConfigurationError, ErrorCode}; use miau::configuration::Key; let error: ConfigurationError = ErrorCode::NullValue.into(); println!("Basic display : {}", error); println!("Pretty display : {}", error.pretty_display());
Methods from Deref<Target = ErrorImpl>
pub fn get_code(&self) -> &ErrorCode
[src]
Returns reference to underlying cause of the error.
pub fn get_path(&self) -> Option<&[Key]>
[src]
Returns path in configuration at which error occured.
Returned value is a slice with configuration keys counting from root.
pub fn get_context(&self) -> Option<&[String]>
[src]
Returns additional context attached to error.
This information can contain, for instance, name of the file that was not found.
Trait Implementations
impl Debug for ConfigurationError
[src]
impl Deref for ConfigurationError
[src]
type Target = ErrorImpl
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl Display for ConfigurationError
[src]
impl Error for ConfigurationError
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl Error for ConfigurationError
[src]
fn custom<T>(msg: T) -> Self where
T: Display,
[src]
T: Display,
pub fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
[src]
pub fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
[src]
pub fn invalid_length(len: usize, exp: &dyn Expected) -> Self
[src]
pub fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
[src]
pub fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
[src]
pub fn missing_field(field: &'static str) -> Self
[src]
pub fn duplicate_field(field: &'static str) -> Self
[src]
impl From<Error> for ConfigurationError
[src]
impl From<ErrorCode> for ConfigurationError
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ConfigurationError
[src]
impl Send for ConfigurationError
[src]
impl Sync for ConfigurationError
[src]
impl Unpin for ConfigurationError
[src]
impl !UnwindSafe for ConfigurationError
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,