pub struct Error {
pub code: String,
pub message: String,
pub line: usize,
pub column: usize,
}Expand description
A parse failure.
code is the contract: the shared fixtures pin ERROR:<code> and compare
it exactly. Css::parse raises only the two codes the
canonical port inherits from the engine — unterminated_comment and
unexpected — and this crate declares none of its own, matching
tabnas.plugin.json (errorCodes: []). The engine’s own tree form can
also stop with cancel, at TREE_RULE_DEPTH.
Fields§
§code: StringThe error code, compared exactly by the conformance fixtures.
message: StringA human-readable explanation.
line: usize1-based line where the failure was found.
column: usize1-based column (UTF-16 code units) where the failure was found.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<TabnasError> for Error
An engine error as this crate’s, with the column in UTF-16 code units.
impl From<TabnasError> for Error
An engine error as this crate’s, with the column in UTF-16 code units.
The engine counts a column in Unicode scalars since the last reset (a
\n in any token, or the end of a run of line characters); the canonical
port counts UTF-16 code units since the same points. The two differ by
the astral characters between the reset and the error, which is what is
added here. The message is the engine’s, and is not the contract.
Source§fn from(error: TabnasError) -> Error
fn from(error: TabnasError) -> Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.