[−][src]Struct logos::Skip
Type that can be returned from a callback, informing the Lexer
, to skip
current token match. See also logos::skip
.
Example
use logos::{Logos, Skip}; #[derive(Logos, Debug, PartialEq)] enum Token<'a> { // We will treat "abc" as if it was whitespace. // This is identical to using `logos::skip`. #[regex(" |abc", |_| Skip)] #[error] Error, #[regex("[a-zA-Z]+")] Text(&'a str), } let tokens: Vec<_> = Token::lexer("Hello abc world").collect(); assert_eq!( tokens, &[ Token::Text("Hello"), Token::Text("world"), ], );
Auto Trait Implementations
impl RefUnwindSafe for Skip
impl Send for Skip
impl Sync for Skip
impl Unpin for Skip
impl UnwindSafe for Skip
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,