pub struct TokenScanner;Expand description
Locale-aware token scanner used by parser prefilters.
Implementations§
Source§impl TokenScanner
impl TokenScanner
Sourcepub fn scan_locale(text: &str, locale: Locale) -> Vec<Token>
pub fn scan_locale(text: &str, locale: Locale) -> Vec<Token>
Scan text using the automaton for the provided locale.
Sourcepub fn contains_type(text: &str, token_type: TokenType) -> bool
pub fn contains_type(text: &str, token_type: TokenType) -> bool
Return true if the scanned text contains a token of the given type.
Sourcepub fn has_date_hint(text: &str) -> bool
pub fn has_date_hint(text: &str) -> bool
Return true if the text appears to contain date-related hints.
This fast heuristic treats any digits or any scanned token as a hint.
Auto Trait Implementations§
impl Freeze for TokenScanner
impl RefUnwindSafe for TokenScanner
impl Send for TokenScanner
impl Sync for TokenScanner
impl Unpin for TokenScanner
impl UnsafeUnpin for TokenScanner
impl UnwindSafe for TokenScanner
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