pub struct FunctionSig {
pub grammar: &'static str,
pub name: String,
pub start: Location,
pub end: Location,
pub range: [u32; 2],
pub token_count: u32,
pub shingles: Vec<u64>,
pub minhash: [u64; 64],
}Expand description
Structural summary of one function, method or arrow function.
Fields§
§grammar: &'static strGrammar that produced the node-type sequence; pairs are only formed within one grammar.
name: StringDeclared or inferred name (<arrow> / <anonymous> when none).
start: Location§end: Location§range: [u32; 2]Inclusive detection-token index range inside the owning source.
token_count: u32Detection tokens covered by the function.
shingles: Vec<u64>Sorted bag of shingle hashes.
minhash: [u64; 64]Implementations§
Source§impl FunctionSig
impl FunctionSig
Sourcepub fn build(
grammar: &'static str,
name: String,
start: Location,
end: Location,
kinds: &[u16],
spans: &[(Location, Location)],
) -> Option<Self>
pub fn build( grammar: &'static str, name: String, start: Location, end: Location, kinds: &[u16], spans: &[(Location, Location)], ) -> Option<Self>
Build a signature from a node-type sequence and the owning source’s
token spans. Returns None when no detection token lies inside the
function’s byte range (comment-only or type-only bodies).
Trait Implementations§
Source§impl Clone for FunctionSig
impl Clone for FunctionSig
Source§fn clone(&self) -> FunctionSig
fn clone(&self) -> FunctionSig
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 FunctionSig
impl Debug for FunctionSig
Source§impl PartialEq for FunctionSig
impl PartialEq for FunctionSig
impl StructuralPartialEq for FunctionSig
Auto Trait Implementations§
impl Freeze for FunctionSig
impl RefUnwindSafe for FunctionSig
impl Send for FunctionSig
impl Sync for FunctionSig
impl Unpin for FunctionSig
impl UnsafeUnpin for FunctionSig
impl UnwindSafe for FunctionSig
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