pub struct TokenText<T: TreeToken = SyntaxToken>(/* private fields */);
Expand description
Helper for hashing tokens by their text.
Normally a token’s equality and hash implementation work by comparing the token’s element in the tree; thus, two tokens with the same text but different positions in the tree will compare and hash differently.
With this hash implementation, two tokens compare and hash identically if their text is identical.
Implementations§
Trait Implementations§
impl<T: TreeToken> Eq for TokenText<T>
Auto Trait Implementations§
impl<T> Freeze for TokenText<T>where
T: Freeze,
impl<T> RefUnwindSafe for TokenText<T>where
T: RefUnwindSafe,
impl<T> Send for TokenText<T>where
T: Send,
impl<T> Sync for TokenText<T>where
T: Sync,
impl<T> Unpin for TokenText<T>where
T: Unpin,
impl<T> UnwindSafe for TokenText<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