pub struct TokenFinder<TTokenCollection> { /* private fields */ }
Expand description
Searches a token collection for
Implementations§
source§impl<'a, TTokenCollection> TokenFinder<TTokenCollection>where
TTokenCollection: TokenCollection<'a>,
impl<'a, TTokenCollection> TokenFinder<TTokenCollection>where
TTokenCollection: TokenCollection<'a>,
pub fn new(tokens: TTokenCollection) -> TokenFinder<TTokenCollection>
pub fn get_next_token_if( &mut self, end: TTokenCollection::TPos, is_match: impl FnOnce(&'a TTokenCollection::TToken) -> bool, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_next_token( &mut self, end: TTokenCollection::TPos, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_previous_token_if( &mut self, start: TTokenCollection::TPos, is_match: impl FnOnce(&'a TTokenCollection::TToken) -> bool, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_previous_token( &mut self, start: TTokenCollection::TPos, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_first_token_within( &mut self, start: TTokenCollection::TPos, end: TTokenCollection::TPos, is_match: impl Fn(&'a TTokenCollection::TToken) -> bool, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_last_token_within( &mut self, start: TTokenCollection::TPos, end: TTokenCollection::TPos, is_match: impl Fn(&'a TTokenCollection::TToken) -> bool, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_first_token_before( &mut self, start: TTokenCollection::TPos, is_match: impl Fn(&'a TTokenCollection::TToken) -> bool, ) -> Option<&'a TTokenCollection::TToken>
pub fn get_first_token_after( &mut self, end: TTokenCollection::TPos, is_match: impl Fn(&'a TTokenCollection::TToken) -> bool, ) -> Option<&'a TTokenCollection::TToken>
Auto Trait Implementations§
impl<TTokenCollection> Freeze for TokenFinder<TTokenCollection>where
TTokenCollection: Freeze,
impl<TTokenCollection> RefUnwindSafe for TokenFinder<TTokenCollection>where
TTokenCollection: RefUnwindSafe,
impl<TTokenCollection> Send for TokenFinder<TTokenCollection>where
TTokenCollection: Send,
impl<TTokenCollection> Sync for TokenFinder<TTokenCollection>where
TTokenCollection: Sync,
impl<TTokenCollection> Unpin for TokenFinder<TTokenCollection>where
TTokenCollection: Unpin,
impl<TTokenCollection> UnwindSafe for TokenFinder<TTokenCollection>where
TTokenCollection: UnwindSafe,
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