pub struct ModuleMetrics {
pub path: PathBuf,
pub name: String,
pub trait_impl_count: usize,
pub inherent_impl_count: usize,
pub function_call_count: usize,
pub type_usage_count: usize,
pub external_deps: Vec<String>,
pub internal_deps: Vec<String>,
pub type_definitions: HashMap<String, TypeDefinition>,
}Expand description
Aggregated metrics for a module
Fields§
§path: PathBufModule path
name: StringModule name
trait_impl_count: usizeNumber of trait implementations (contract coupling)
inherent_impl_count: usizeNumber of inherent implementations (intrusive coupling)
function_call_count: usizeNumber of function calls
type_usage_count: usizeNumber of struct/enum usages
external_deps: Vec<String>External crate dependencies
internal_deps: Vec<String>Internal module dependencies
type_definitions: HashMap<String, TypeDefinition>Type definitions in this module with visibility info
Implementations§
Source§impl ModuleMetrics
impl ModuleMetrics
pub fn new(path: PathBuf, name: String) -> Self
Sourcepub fn add_type_definition(
&mut self,
name: String,
visibility: Visibility,
is_trait: bool,
)
pub fn add_type_definition( &mut self, name: String, visibility: Visibility, is_trait: bool, )
Add a type definition to this module
Sourcepub fn get_type_visibility(&self, name: &str) -> Option<Visibility>
pub fn get_type_visibility(&self, name: &str) -> Option<Visibility>
Get visibility of a type defined in this module
Sourcepub fn public_type_count(&self) -> usize
pub fn public_type_count(&self) -> usize
Count public types
Sourcepub fn private_type_count(&self) -> usize
pub fn private_type_count(&self) -> usize
Count non-public types
Sourcepub fn average_strength(&self) -> f64
pub fn average_strength(&self) -> f64
Calculate average integration strength
Trait Implementations§
Source§impl Clone for ModuleMetrics
impl Clone for ModuleMetrics
Source§fn clone(&self) -> ModuleMetrics
fn clone(&self) -> ModuleMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModuleMetrics
impl Debug for ModuleMetrics
Source§impl Default for ModuleMetrics
impl Default for ModuleMetrics
Source§fn default() -> ModuleMetrics
fn default() -> ModuleMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModuleMetrics
impl RefUnwindSafe for ModuleMetrics
impl Send for ModuleMetrics
impl Sync for ModuleMetrics
impl Unpin for ModuleMetrics
impl UnwindSafe for ModuleMetrics
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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