pub struct Interner<T> { /* private fields */ }
Available on crate feature
blob
only.Expand description
An interner that allows for fast access of tokens produced by a TokenSource
.
Implementations§
Source§impl<T> Interner<T>
impl<T> Interner<T>
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 initial capacity calculated by summing the results of 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.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Interner<T>
impl<T> RefUnwindSafe for Interner<T>where
T: RefUnwindSafe,
impl<T> Send for Interner<T>where
T: Send,
impl<T> Sync for Interner<T>where
T: Sync,
impl<T> Unpin for Interner<T>where
T: Unpin,
impl<T> UnwindSafe for Interner<T>where
T: 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