pub struct Error {
pub message: String,
pub line: usize,
pub col: usize,
/* private fields */
}Expand description
A compilation error, carrying a human-readable message and a 1-based
source position (line/col are 0 when the position is unknown).
Implements std::error::Error, so it composes with ? and the
wider error ecosystem.
For byte-exact dart-sass diagnostics the evaluator attaches a span
length (in source bytes) and a rendered snippet
block at the AST-node boundary. When rendered is present, [Display]
emits it verbatim (the full Error: … + source-span snippet + stack
trace); otherwise it falls back to the legacy Error: <msg> (line:col)
one-liner.
Fields§
§message: StringHuman-readable description of what went wrong.
line: usize1-based line number, or 0 if unknown.
col: usize1-based column number, or 0 if unknown.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
impl StructuralPartialEq for Error
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