pub enum ParseError<'a, I> {
Mismatch {
input: &'a [I],
offset: usize,
length: usize,
message: String,
},
Conversion {
input: &'a [I],
offset: usize,
length: usize,
message: String,
},
Incomplete,
Expect {
offset: usize,
inner: Box<ParseError<'a, I>>,
message: String,
},
Custom {
offset: usize,
inner: Option<Box<ParseError<'a, I>>>,
message: String,
},
}
Expand description
The enum type representing the parsing error.
解析エラーを示す列挙型。
Variants§
Mismatch
パーサの条件にマッチしなかった場合のエラー
Conversion
変換に失敗した際のエラー
Incomplete
解析中断のエラー
Expect
期待から逸れた際のエラー
Custom
カスタムエラー
Implementations§
Source§impl<'a> ParseError<'a, char>
impl<'a> ParseError<'a, char>
pub fn input_string(&self) -> Option<String>
Source§impl<'a> ParseError<'a, u8>
impl<'a> ParseError<'a, u8>
pub fn input_string(&self) -> Option<String>
Source§impl<'a, I> ParseError<'a, I>
impl<'a, I> ParseError<'a, I>
pub fn input(&self) -> Option<&'a [I]>
pub fn is_expect(&self) -> bool
pub fn is_custom(&self) -> bool
pub fn is_mismatch(&self) -> bool
pub fn is_conversion(&self) -> bool
pub fn is_in_complete(&self) -> bool
pub fn of_expect( offset: usize, inner: Box<ParseError<'a, I>>, message: String, ) -> Self
pub fn of_custom( offset: usize, inner: Option<Box<ParseError<'a, I>>>, message: String, ) -> Self
pub fn of_mismatch( input: &'a [I], offset: usize, length: usize, message: String, ) -> Self
pub fn of_conversion( input: &'a [I], offset: usize, length: usize, message: String, ) -> Self
pub fn of_in_complete() -> Self
Trait Implementations§
Source§impl<'a, I: Clone> Clone for ParseError<'a, I>
impl<'a, I: Clone> Clone for ParseError<'a, I>
Source§fn clone(&self) -> ParseError<'a, I>
fn clone(&self) -> ParseError<'a, I>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, I: Debug> Debug for ParseError<'a, I>
impl<'a, I: Debug> Debug for ParseError<'a, I>
Source§impl<'a, I> Display for ParseError<'a, I>
impl<'a, I> Display for ParseError<'a, I>
Source§impl<'a, I: PartialEq> PartialEq for ParseError<'a, I>
impl<'a, I: PartialEq> PartialEq for ParseError<'a, I>
Source§impl<'a, I: PartialOrd> PartialOrd for ParseError<'a, I>
impl<'a, I: PartialOrd> PartialOrd for ParseError<'a, I>
impl<'a, I> StructuralPartialEq for ParseError<'a, I>
Auto Trait Implementations§
impl<'a, I> Freeze for ParseError<'a, I>
impl<'a, I> RefUnwindSafe for ParseError<'a, I>where
I: RefUnwindSafe,
impl<'a, I> Send for ParseError<'a, I>where
I: Sync,
impl<'a, I> Sync for ParseError<'a, I>where
I: Sync,
impl<'a, I> Unpin for ParseError<'a, I>
impl<'a, I> UnwindSafe for ParseError<'a, I>where
I: RefUnwindSafe,
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