pub struct YamlError { /* private fields */ }Expand description
A YAML parse or emit failure, owned by this crate.
The YAML engine is serde-saphyr. Returning its error types from a public
signature would chain this crate’s major version to that crate’s, and to
the choice of engine at all, so the boundary converts to this type instead
and no public signature names the engine. The engine is an implementation
detail; this is what the contract says it is.
line/column are 1-indexed and present only when the engine located the
failure: always absent on the emit side, which has no input to point at.
Implementations§
Source§impl YamlError
impl YamlError
Sourcepub fn hint(&self) -> Option<&str>
pub fn hint(&self) -> Option<&str>
The concrete textual fix, when the failure is one this crate recognizes.
Sourcepub fn column(&self) -> Option<u32>
pub fn column(&self) -> Option<u32>
1-indexed column of the failure, paired with Self::line.
Sourcepub fn to_diagnostic(&self, code: &str, file: &str) -> Diagnostic
pub fn to_diagnostic(&self, code: &str, file: &str) -> Diagnostic
A diagnostic under code, carrying the hint and (when the engine
located the failure) a Location against file.
Trait Implementations§
impl Eq for YamlError
Source§impl Error for YamlError
impl Error for YamlError
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()
impl StructuralPartialEq for YamlError
Auto Trait Implementations§
impl Freeze for YamlError
impl RefUnwindSafe for YamlError
impl Send for YamlError
impl Sync for YamlError
impl Unpin for YamlError
impl UnsafeUnpin for YamlError
impl UnwindSafe for YamlError
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.