pub struct SuspectRegistry { /* private fields */ }Expand description
Thread-safe registry of constant definitions across all files. Uses DashMap for lock-free concurrent access during parallel scanning.
Keys are fully qualified (file::module::name) to avoid namespace collisions between constants with the same name in different modules/files.
Implementations§
Source§impl SuspectRegistry
impl SuspectRegistry
Sourcepub fn insert(&self, def: ConstantDefinition)
pub fn insert(&self, def: ConstantDefinition)
Insert a constant definition
Sourcepub fn get_value(&self, name: &str) -> Option<String>
pub fn get_value(&self, name: &str) -> Option<String>
Look up a constant by name, preferring definitions from the same file. Returns the value if found unambiguously, or the highest-scored match if there are multiple definitions with the same name.
Sourcepub fn get(&self, name: &str) -> Option<ConstantDefinition>
pub fn get(&self, name: &str) -> Option<ConstantDefinition>
Look up a constant by name, preferring definitions from the same file.
Sourcepub fn get_value_for_file(&self, name: &str, file: &Path) -> Option<String>
pub fn get_value_for_file(&self, name: &str, file: &Path) -> Option<String>
Look up a constant by name, preferring definitions from the specified file. This provides better accuracy when the caller knows which file they’re analyzing.
Sourcepub fn get_for_file(
&self,
name: &str,
file: &Path,
) -> Option<ConstantDefinition>
pub fn get_for_file( &self, name: &str, file: &Path, ) -> Option<ConstantDefinition>
Look up a constant by name, preferring definitions from the specified file.
Sourcepub fn get_all_by_name(&self, name: &str) -> Vec<ConstantDefinition>
pub fn get_all_by_name(&self, name: &str) -> Vec<ConstantDefinition>
Get all definitions with the given name (for diagnostics/debugging)
Sourcepub fn stats(&self) -> RegistryStats
pub fn stats(&self) -> RegistryStats
Get statistics about the registry
Sourcepub fn iter(&self) -> impl Iterator<Item = ConstantDefinition> + '_
pub fn iter(&self) -> impl Iterator<Item = ConstantDefinition> + '_
Iterate over all entries
Trait Implementations§
Source§impl Clone for SuspectRegistry
impl Clone for SuspectRegistry
Auto Trait Implementations§
impl Freeze for SuspectRegistry
impl !RefUnwindSafe for SuspectRegistry
impl Send for SuspectRegistry
impl Sync for SuspectRegistry
impl Unpin for SuspectRegistry
impl !UnwindSafe for SuspectRegistry
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<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