Skip to main content

ReferenceIntegrityChecker

Struct ReferenceIntegrityChecker 

Source
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, &registry);

// 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>

Source

pub fn new( graph: &'a CodeGraphV2, typeflow: &'a TypeFlowGraphV2, registry: &'a SymbolRegistry, ) -> Self

Create a new ReferenceIntegrityChecker.

Source

pub fn check_deletion_impact( &self, symbol_id: SymbolId, ) -> ReferenceIntegrityResult

Check the impact of deleting a symbol.

Returns all references that would become dangling.

Source

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.

Source

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.

Source

pub fn check_field_removal_impact( &self, struct_id: SymbolId, field_name: &str, ) -> ReferenceIntegrityResult

Check if removing a field would affect struct literals.

Source

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.

Source

pub fn get_all_referrers(&self, symbol_id: SymbolId) -> Vec<SymbolId>

Get all referrers of a symbol (type_users + callers).

Source

pub fn is_symbol_unused(&self, symbol_id: SymbolId) -> bool

Check if a symbol is unused (no call references and no type references).

Source

pub fn reference_count(&self, symbol_id: SymbolId) -> usize

Get total reference count for a symbol (calls + type references).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.