pub struct FunctionFingerprint {
pub hash: u64,
pub normalized_tokens: Vec<NormalizedToken>,
pub locations: Vec<FileLocation>,
pub token_count: usize,
pub function_name: String,
}Expand description
Unique identifier for a normalized function body
Fields§
§hash: u64§normalized_tokens: Vec<NormalizedToken>§locations: Vec<FileLocation>§token_count: usize§function_name: StringImplementations§
Source§impl FunctionFingerprint
impl FunctionFingerprint
Sourcepub fn new(
normalized_tokens: Vec<NormalizedToken>,
location: FileLocation,
function_name: String,
) -> Self
pub fn new( normalized_tokens: Vec<NormalizedToken>, location: FileLocation, function_name: String, ) -> Self
Create a new fingerprint from normalized tokens and compute hash
Sourcepub fn add_location(&mut self, location: FileLocation)
pub fn add_location(&mut self, location: FileLocation)
Add another location where this pattern appears
Trait Implementations§
Source§impl Clone for FunctionFingerprint
impl Clone for FunctionFingerprint
Source§fn clone(&self) -> FunctionFingerprint
fn clone(&self) -> FunctionFingerprint
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 FunctionFingerprint
impl Debug for FunctionFingerprint
Source§impl Hash for FunctionFingerprint
impl Hash for FunctionFingerprint
Source§impl Ord for FunctionFingerprint
impl Ord for FunctionFingerprint
Source§fn cmp(&self, other: &FunctionFingerprint) -> Ordering
fn cmp(&self, other: &FunctionFingerprint) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FunctionFingerprint
impl PartialEq for FunctionFingerprint
Source§fn eq(&self, other: &FunctionFingerprint) -> bool
fn eq(&self, other: &FunctionFingerprint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for FunctionFingerprint
impl PartialOrd for FunctionFingerprint
impl Eq for FunctionFingerprint
impl StructuralPartialEq for FunctionFingerprint
Auto Trait Implementations§
impl Freeze for FunctionFingerprint
impl RefUnwindSafe for FunctionFingerprint
impl Send for FunctionFingerprint
impl Sync for FunctionFingerprint
impl Unpin for FunctionFingerprint
impl UnsafeUnpin for FunctionFingerprint
impl UnwindSafe for FunctionFingerprint
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.