pub struct UnrecognizedToken<'a> { /* private fields */ }Expand description
Parsing failure due to an unrecognized attribute or enum discriminator
This struct encapsulates a token that the parser tried to consume but did not recognize, along
with a TokenStream containing tokens that directly follow this token. In other words, it
should be constructed from both values returned by TokenStream::take.
Implementations§
Source§impl<'a> UnrecognizedToken<'a>
impl<'a> UnrecognizedToken<'a>
Sourcepub fn new(token: Token<'a>, remaining: TokenStream<'a>) -> Self
pub fn new(token: Token<'a>, remaining: TokenStream<'a>) -> Self
Create a new UnrecognizedToken instance from a token that was not recognized by the
parser and the remaining tokens stream.
Sourcepub fn remaining(&self) -> &TokenStream<'a>
pub fn remaining(&self) -> &TokenStream<'a>
Returns a token stream that represents tokens that follow the token.
Sourcepub fn into_error(self) -> ParseError<'a>
pub fn into_error(self) -> ParseError<'a>
Converts this UnrecognizedToken into a ParseError.
Trait Implementations§
Source§impl<'a> Debug for UnrecognizedToken<'a>
impl<'a> Debug for UnrecognizedToken<'a>
Source§impl<'a> From<UnrecognizedToken<'a>> for ParseFailure<'a>
impl<'a> From<UnrecognizedToken<'a>> for ParseFailure<'a>
Source§fn from(unrecognized: UnrecognizedToken<'a>) -> Self
fn from(unrecognized: UnrecognizedToken<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for UnrecognizedToken<'a>
impl<'a> RefUnwindSafe for UnrecognizedToken<'a>
impl<'a> Send for UnrecognizedToken<'a>
impl<'a> Sync for UnrecognizedToken<'a>
impl<'a> Unpin for UnrecognizedToken<'a>
impl<'a> UnwindSafe for UnrecognizedToken<'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