pub struct DetectionToken {
pub hash: u64,
pub start: Location,
pub end: Location,
pub range: [usize; 2],
}Expand description
Internal detection unit — no heap allocation per token.
Produced by the tokenizer’s detection path at tokenize time.
Token is used for display, blame, and reporter output;
DetectionToken is used only during the clone detection hot path.
The token’s value string is not stored — only its pre-computed hash.
Fields§
§hash: u64Pre-computed hash of (kind, value) — detection never re-hashes.
start: Location§end: Location§range: [usize; 2]Byte range in the source content: [start_byte, end_byte].
Trait Implementations§
Source§impl Clone for DetectionToken
impl Clone for DetectionToken
Source§fn clone(&self) -> DetectionToken
fn clone(&self) -> DetectionToken
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DetectionToken
impl Debug for DetectionToken
impl Eq for DetectionToken
Source§impl PartialEq for DetectionToken
impl PartialEq for DetectionToken
Source§fn eq(&self, other: &DetectionToken) -> bool
fn eq(&self, other: &DetectionToken) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DetectionToken
Auto Trait Implementations§
impl Freeze for DetectionToken
impl RefUnwindSafe for DetectionToken
impl Send for DetectionToken
impl Sync for DetectionToken
impl Unpin for DetectionToken
impl UnsafeUnpin for DetectionToken
impl UnwindSafe for DetectionToken
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more