pub struct CouplingMetrics {
pub source: String,
pub target: String,
pub strength: IntegrationStrength,
pub distance: Distance,
pub volatility: Volatility,
pub source_crate: Option<String>,
pub target_crate: Option<String>,
pub target_visibility: Visibility,
pub location: CouplingLocation,
}Expand description
Metrics for a single coupling relationship
Fields§
§source: StringSource component
target: StringTarget component
strength: IntegrationStrengthIntegration strength
distance: DistanceDistance between components
volatility: VolatilityVolatility of the target
source_crate: Option<String>Source crate name (when workspace analysis is available)
target_crate: Option<String>Target crate name (when workspace analysis is available)
target_visibility: VisibilityVisibility of the target item (for intrusive detection)
location: CouplingLocationLocation where the coupling occurs
Implementations§
Source§impl CouplingMetrics
impl CouplingMetrics
Sourcepub fn new(
source: String,
target: String,
strength: IntegrationStrength,
distance: Distance,
volatility: Volatility,
) -> Self
pub fn new( source: String, target: String, strength: IntegrationStrength, distance: Distance, volatility: Volatility, ) -> Self
Create new coupling metrics
Sourcepub fn with_visibility(
source: String,
target: String,
strength: IntegrationStrength,
distance: Distance,
volatility: Volatility,
visibility: Visibility,
) -> Self
pub fn with_visibility( source: String, target: String, strength: IntegrationStrength, distance: Distance, volatility: Volatility, visibility: Visibility, ) -> Self
Create new coupling metrics with visibility
Sourcepub fn with_location(
source: String,
target: String,
strength: IntegrationStrength,
distance: Distance,
volatility: Volatility,
visibility: Visibility,
file_path: PathBuf,
line: usize,
) -> Self
pub fn with_location( source: String, target: String, strength: IntegrationStrength, distance: Distance, volatility: Volatility, visibility: Visibility, file_path: PathBuf, line: usize, ) -> Self
Create new coupling metrics with location
Sourcepub fn is_visibility_intrusive(&self) -> bool
pub fn is_visibility_intrusive(&self) -> bool
Check if this coupling represents intrusive access based on visibility
Returns true if the target’s visibility suggests this is access to internal implementation details rather than a public API.
Sourcepub fn effective_strength(&self) -> IntegrationStrength
pub fn effective_strength(&self) -> IntegrationStrength
Get effective strength considering visibility
If the target is not publicly visible and being accessed from outside, the coupling is considered more intrusive.
Sourcepub fn effective_strength_value(&self) -> f64
pub fn effective_strength_value(&self) -> f64
Get effective strength value considering visibility
Sourcepub fn strength_value(&self) -> f64
pub fn strength_value(&self) -> f64
Get numeric strength value
Sourcepub fn distance_value(&self) -> f64
pub fn distance_value(&self) -> f64
Get numeric distance value
Sourcepub fn volatility_value(&self) -> f64
pub fn volatility_value(&self) -> f64
Get numeric volatility value
Trait Implementations§
Source§impl Clone for CouplingMetrics
impl Clone for CouplingMetrics
Source§fn clone(&self) -> CouplingMetrics
fn clone(&self) -> CouplingMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CouplingMetrics
impl RefUnwindSafe for CouplingMetrics
impl Send for CouplingMetrics
impl Sync for CouplingMetrics
impl Unpin for CouplingMetrics
impl UnsafeUnpin for CouplingMetrics
impl UnwindSafe for CouplingMetrics
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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