Struct imara_diff::intern::Interner
source · pub struct Interner<T: Hash + Eq> { /* private fields */ }
Expand description
A hastable based interner that allows
Implementations§
source§impl<T: Hash + Eq> Interner<T>
impl<T: Hash + Eq> Interner<T>
sourcepub fn new_for_token_source<S: TokenSource<Token = T>>(
before: &S,
after: &S,
) -> Self
pub fn new_for_token_source<S: TokenSource<Token = T>>( before: &S, after: &S, ) -> Self
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.
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