pub struct Interner<T>where
T: Hash + Eq,{ /* private fields */ }
Expand description
A hastable based interner that allows
Implementations§
source§impl<T> Interner<T>where
T: Hash + Eq,
impl<T> Interner<T>where T: Hash + Eq,
sourcepub fn new_for_token_source<S>(before: &S, after: &S) -> Interner<T>where
S: TokenSource<Token = T>,
pub fn new_for_token_source<S>(before: &S, after: &S) -> Interner<T>where S: TokenSource<Token = T>,
Create an Interner with an intial capacity calculated by calling
estimate_tokens
methods of before
and after
sourcepub fn num_tokens(&self) -> u32
pub fn num_tokens(&self) -> u32
Returns to total number of distinct tokens currently interned.
sourcepub fn erase_tokens_after(&mut self, first_erased_token: Token)
pub fn erase_tokens_after(&mut self, first_erased_token: Token)
Erases first_erased_token
and any tokens interned afterwards from the interner.