Enum yggdrasil_rt::TokenQueue
source · pub enum TokenQueue<R> {
Start {
end_token_index: usize,
input_offset: usize,
},
End {
start_token_index: usize,
input_offset: usize,
rule: R,
tag: &'static str,
},
}
Expand description
This structure serves to improve performance over Token objects in two ways:
- it is smaller than a Token, leading to both less memory use when stored in the queue but also increased speed when pushing to the queue
- it finds its pair in O(1) time instead of O(N), since pair positions are known at parse time and can easily be stored instead of recomputed
Variants§
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for TokenQueue<R>where
R: Freeze,
impl<R> RefUnwindSafe for TokenQueue<R>where
R: RefUnwindSafe,
impl<R> Send for TokenQueue<R>where
R: Send,
impl<R> Sync for TokenQueue<R>where
R: Sync,
impl<R> Unpin for TokenQueue<R>where
R: Unpin,
impl<R> UnwindSafe for TokenQueue<R>where
R: 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