Struct ParseError
pub struct ParseError {
kind: ParseErrorKind,
offset: usize,
}Available on crate feature
parse only.Expand description
An interface definition that couldn’t be parsed.
It doesn’t borrow the input. Use offset or
line_column to find the offending text.
Fields§
§kind: ParseErrorKind§offset: usizeImplementations§
§impl ParseError
impl ParseError
pub const fn kind(self) -> ParseErrorKind
pub const fn kind(self) -> ParseErrorKind
Returns why parsing failed.
pub fn line_column(self, input: &str) -> (usize, usize)
pub fn line_column(self, input: &str) -> (usize, usize)
Returns the 1-based line and column of the error in input.
input must be the text that was parsed. Lines end at the same line
breaks as for the parser: \n, \r\n, \r, U+2028 and U+2029. The
column counts characters.
pub(super) const fn invalid(offset: usize, kind: ValidationErrorKind) -> Self
pub(super) const fn new(offset: usize, kind: ParseErrorKind) -> Self
pub(super) const fn invalid_name( offset: usize, kind: NameKind, error: InvalidName, ) -> Self
pub(super) const fn unexpected(offset: usize, expected: Expected) -> Self
Trait Implementations§
§impl Clone for ParseError
impl Clone for ParseError
§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParseError
§impl Debug for ParseError
impl Debug for ParseError
§impl Display for ParseError
impl Display for ParseError
impl Eq for ParseError
§impl Error for ParseError
impl Error for ParseError
§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 PartialEq for ParseError
impl PartialEq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnsafeUnpin for ParseError
impl UnwindSafe for ParseError
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