pub struct FuncKey {
pub lang: Lang,
pub namespace: String,
pub container: String,
pub name: String,
pub arity: Option<usize>,
pub disambig: Option<u32>,
pub kind: FuncKind,
}Expand description
Uniquely identifies a function across the entire project.
Identity is a 6-tuple: (lang, namespace, container, name, arity, disambig)
plus a structural kind tag. Every field is deliberately narrow so
legitimately-distinct definitions never collide:
lang, prevents cross-language aliasing.namespace, project-relative source file path.container, enclosing class / impl / module / namespace / outer function (qualified with::for nested containers). Empty string for free top-level functions.name, leaf identifier as written in source.arity, parameter count (includingself/this) for languages that discriminate by arity.Nonefor unknown.disambig, numeric discriminator for same-name definitions in the same container (closure byte offset, nested-function occurrence index).Nonefor the common case of a single definition.kind, structural role (seeFuncKind). Separates e.g. a getter namedsizefrom a methodsize().
Backward-compat: container, disambig, and kind all have serde
defaults, so JSON summaries written by the old identity model still
deserialise cleanly and land on FuncKind::Function with empty
container/disambig.
Fields§
§lang: Lang§namespace: StringProject-relative file path (e.g. "src/lib.rs").
container: StringEnclosing container path (class / impl / module / nested function).
Empty for free top-level functions. Segments joined with ::.
name: String§arity: Option<usize>§disambig: Option<u32>Numeric discriminator for same-name siblings (closures, duplicate defs). Typically the function node’s start byte offset.
kind: FuncKindStructural role, Function, Method, Constructor, Closure, etc.
Implementations§
Source§impl FuncKey
impl FuncKey
Sourcepub fn new_function(
lang: Lang,
namespace: impl Into<String>,
name: impl Into<String>,
arity: Option<usize>,
) -> Self
pub fn new_function( lang: Lang, namespace: impl Into<String>, name: impl Into<String>, arity: Option<usize>, ) -> Self
Construct a plain free-function key (no container, no disambig). Kept as a convenience for call sites and tests that do not need the extra discriminators.
Sourcepub fn qualified_name(&self) -> String
pub fn qualified_name(&self) -> String
Fully-qualified name like "Class::method" or just "func" for free
functions. Used for diagnostics and container-aware callee matching.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FuncKey
impl<'de> Deserialize<'de> for FuncKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FuncKey
impl StructuralPartialEq for FuncKey
Auto Trait Implementations§
impl Freeze for FuncKey
impl RefUnwindSafe for FuncKey
impl Send for FuncKey
impl Sync for FuncKey
impl Unpin for FuncKey
impl UnsafeUnpin for FuncKey
impl UnwindSafe for FuncKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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