Struct Fingerprint
pub struct Fingerprint {
pub digest: [u8; 32],
pub node_count: u32,
}Expand description
One function-or-file’s structural fingerprint.
Fields§
§digest: [u8; 32]256-bit SHA-256 of the pre-order (kind_name, child_count) byte
sequence (identifiers, literals, and comments omitted).
node_count: u32Number of AST nodes that contributed to the fingerprint (i.e. the nodes that survived the identifier/literal skip filter). Use this as the minimum-fragment-size knob to drop trivial getters/setters.
Implementations§
§impl Fingerprint
impl Fingerprint
pub fn from_sequence(sequence: &[(&str, u16)]) -> Self
pub fn from_sequence(sequence: &[(&str, u16)]) -> Self
Build a Fingerprint directly from a pre-computed (kind_name, arity)
sequence. Used by the function extractor in clones::extractor so it
can run the same walk over a subtree (the function body) instead of
the full file.
Trait Implementations§
§impl Clone for Fingerprint
impl Clone for Fingerprint
§fn clone(&self) -> Fingerprint
fn clone(&self) -> Fingerprint
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 moreAuto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnsafeUnpin for Fingerprint
impl UnwindSafe for Fingerprint
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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