pub struct ReferenceIntegrityChecker<'a> { /* private fields */ }Expand description
Reference Integrity Checker using CodeGraphV2.
Validates that mutations don’t leave dangling references or break existing code that depends on the changed symbols.
§Example
let checker = ReferenceIntegrityChecker::new(&code_graph, ®istry);
// Check impact of deleting a symbol
let result = checker.check_deletion_impact(symbol_to_delete);
if result.has_issues() {
for issue in &result.issues {
println!("Issue: {:?}", issue);
}
}Implementations§
Source§impl<'a> ReferenceIntegrityChecker<'a>
impl<'a> ReferenceIntegrityChecker<'a>
Sourcepub fn new(
graph: &'a CodeGraphV2,
typeflow: &'a TypeFlowGraphV2,
registry: &'a SymbolRegistry,
) -> Self
pub fn new( graph: &'a CodeGraphV2, typeflow: &'a TypeFlowGraphV2, registry: &'a SymbolRegistry, ) -> Self
Create a new ReferenceIntegrityChecker.
Sourcepub fn check_deletion_impact(
&self,
symbol_id: SymbolId,
) -> ReferenceIntegrityResult
pub fn check_deletion_impact( &self, symbol_id: SymbolId, ) -> ReferenceIntegrityResult
Check the impact of deleting a symbol.
Returns all references that would become dangling.
Sourcepub fn check_rename_impact(
&self,
symbol_id: SymbolId,
) -> ReferenceIntegrityResult
pub fn check_rename_impact( &self, symbol_id: SymbolId, ) -> ReferenceIntegrityResult
Check the impact of renaming a symbol.
Returns all locations that would need to be updated.
Sourcepub fn check_field_addition_impact(
&self,
struct_id: SymbolId,
field_name: &str,
) -> ReferenceIntegrityResult
pub fn check_field_addition_impact( &self, struct_id: SymbolId, field_name: &str, ) -> ReferenceIntegrityResult
Check if adding a field would affect struct literals.
This checks all callers that might construct the struct.
Sourcepub fn check_field_removal_impact(
&self,
struct_id: SymbolId,
field_name: &str,
) -> ReferenceIntegrityResult
pub fn check_field_removal_impact( &self, struct_id: SymbolId, field_name: &str, ) -> ReferenceIntegrityResult
Check if removing a field would affect struct literals.
Sourcepub fn check_method_signature_change(
&self,
method_id: SymbolId,
new_arg_count: usize,
) -> ReferenceIntegrityResult
pub fn check_method_signature_change( &self, method_id: SymbolId, new_arg_count: usize, ) -> ReferenceIntegrityResult
Check if a method signature change would break call sites.
Compares expected argument count against actual call sites.
Sourcepub fn get_all_referrers(&self, symbol_id: SymbolId) -> Vec<SymbolId>
pub fn get_all_referrers(&self, symbol_id: SymbolId) -> Vec<SymbolId>
Get all referrers of a symbol (type_users + callers).
Sourcepub fn is_symbol_unused(&self, symbol_id: SymbolId) -> bool
pub fn is_symbol_unused(&self, symbol_id: SymbolId) -> bool
Check if a symbol is unused (no call references and no type references).
Sourcepub fn reference_count(&self, symbol_id: SymbolId) -> usize
pub fn reference_count(&self, symbol_id: SymbolId) -> usize
Get total reference count for a symbol (calls + type references).
Auto Trait Implementations§
impl<'a> Freeze for ReferenceIntegrityChecker<'a>
impl<'a> RefUnwindSafe for ReferenceIntegrityChecker<'a>
impl<'a> Send for ReferenceIntegrityChecker<'a>
impl<'a> Sync for ReferenceIntegrityChecker<'a>
impl<'a> Unpin for ReferenceIntegrityChecker<'a>
impl<'a> UnsafeUnpin for ReferenceIntegrityChecker<'a>
impl<'a> UnwindSafe for ReferenceIntegrityChecker<'a>
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> 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