Struct peginator::PrettyParseError
source · [−]pub struct PrettyParseError { /* private fields */ }Expand description
An error happened during parsing (pretty version).
Converted from ParseError, produces a very pretty, colored error message when printed with
regular std::fmt::Display.
Implementations
sourceimpl PrettyParseError
impl PrettyParseError
sourcepub fn from_parse_error(
err: &ParseError,
text: &str,
source_file: Option<&str>
) -> Self
pub fn from_parse_error(
err: &ParseError,
text: &str,
source_file: Option<&str>
) -> Self
Convert from ParseError
The parsed text needs to be supplied to show the context of the error.
The source_file parameter is used to print the error with the same format rustc does.
Trait Implementations
sourceimpl Clone for PrettyParseError
impl Clone for PrettyParseError
sourcefn clone(&self) -> PrettyParseError
fn clone(&self) -> PrettyParseError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for PrettyParseError
impl Debug for PrettyParseError
sourceimpl Display for PrettyParseError
impl Display for PrettyParseError
sourceimpl Error for PrettyParseError
impl Error for PrettyParseError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations
impl RefUnwindSafe for PrettyParseError
impl Send for PrettyParseError
impl Sync for PrettyParseError
impl Unpin for PrettyParseError
impl UnwindSafe for PrettyParseError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more