pub struct ParseError<'a> { /* private fields */ }Expand description
Error type for the parsing lifecycle.
Wraps one or more diagnostics together with the SourceMap.
Implementations§
Source§impl<'a> ParseError<'a>
impl<'a> ParseError<'a>
Sourcepub fn new(diagnostics: Vec<Diagnostic>, source_map: SourceMap<'a>) -> Self
pub fn new(diagnostics: Vec<Diagnostic>, source_map: SourceMap<'a>) -> Self
Create a new parse error from diagnostics and a source map.
Sourcepub fn from_diagnostic(
diagnostic: Diagnostic,
source_map: SourceMap<'a>,
) -> Self
pub fn from_diagnostic( diagnostic: Diagnostic, source_map: SourceMap<'a>, ) -> Self
Create a parse error from a single diagnostic and a source map.
Sourcepub fn source_map(&self) -> &SourceMap<'a>
pub fn source_map(&self) -> &SourceMap<'a>
Get the source map associated with this error.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Get all diagnostics in this error.
Trait Implementations§
Source§impl<'a> Debug for ParseError<'a>
impl<'a> Debug for ParseError<'a>
Source§impl Display for ParseError<'_>
impl Display for ParseError<'_>
Source§impl<'a> Error for ParseError<'a>
impl<'a> Error for ParseError<'a>
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()
Auto Trait Implementations§
impl<'a> Freeze for ParseError<'a>
impl<'a> RefUnwindSafe for ParseError<'a>
impl<'a> Send for ParseError<'a>
impl<'a> Sync for ParseError<'a>
impl<'a> Unpin for ParseError<'a>
impl<'a> UnsafeUnpin for ParseError<'a>
impl<'a> UnwindSafe for ParseError<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more