pub enum Error {
ParseContext {
display_name: String,
source_text: Box<str>,
start_line: usize,
barrier_context: bool,
diagnostic: ParseDiagnostic,
},
Config {
path: PathBuf,
details: FileParseError,
source_message: Box<str>,
},
Spec {
path: PathBuf,
details: FileParseError,
source_message: Box<str>,
},
Io(Error),
Formatter(String),
LayoutTooWide {
line_no: usize,
width: usize,
limit: usize,
},
}Expand description
Errors that can be returned by parsing, config loading, spec loading, or formatting operations.
Variants§
ParseContext
A parser error annotated with source text and line-offset context.
Fields
§
diagnostic: ParseDiagnosticStructured parser diagnostic.
Config
A user config parse error.
Fields
§
details: FileParseErrorStructured parser details for the failure.
Spec
A built-in or user override spec parse error.
Fields
§
details: FileParseErrorStructured parser details for the failure.
Io(Error)
A filesystem or stream I/O failure.
Formatter(String)
A higher-level formatter or CLI error that does not fit another structured variant.
LayoutTooWide
A formatted line exceeded the configured line width and
require_valid_layout is enabled.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
Mutably borrows from an owned value. Read more