#[non_exhaustive]pub struct DistanceInput { /* private fields */ }Expand description
Immutable numeric input for Robert C. Martin’s component-distance formulas.
Implementations§
Source§impl DistanceInput
impl DistanceInput
Sourcepub const fn new(
concrete_types: usize,
traits: usize,
afferent_coupling: usize,
efferent_coupling: usize,
project_component_count: usize,
lines_of_code: usize,
) -> Self
pub const fn new( concrete_types: usize, traits: usize, afferent_coupling: usize, efferent_coupling: usize, project_component_count: usize, lines_of_code: usize, ) -> Self
Creates a complete formula input.
Sourcepub const fn from_distance_info(info: &DistanceInfo) -> Self
pub const fn from_distance_info(info: &DistanceInfo) -> Self
Builds a formula input from extracted file syntax and coupling evidence.
Sourcepub const fn concrete_types(self) -> usize
pub const fn concrete_types(self) -> usize
Returns concrete struct, enum, and union declarations.
Sourcepub const fn afferent_coupling(self) -> usize
pub const fn afferent_coupling(self) -> usize
Returns incoming coupling.
Sourcepub const fn efferent_coupling(self) -> usize
pub const fn efferent_coupling(self) -> usize
Returns outgoing coupling.
Sourcepub const fn project_component_count(self) -> usize
pub const fn project_component_count(self) -> usize
Returns the size of the full component universe.
Sourcepub const fn lines_of_code(self) -> usize
pub const fn lines_of_code(self) -> usize
Returns physical non-comment source lines.
Trait Implementations§
Source§impl Clone for DistanceInput
impl Clone for DistanceInput
Source§fn clone(&self) -> DistanceInput
fn clone(&self) -> DistanceInput
Returns a copy 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 DistanceInput
impl Debug for DistanceInput
Source§impl PartialEq for DistanceInput
impl PartialEq for DistanceInput
impl Copy for DistanceInput
impl Eq for DistanceInput
impl StructuralPartialEq for DistanceInput
Auto Trait Implementations§
impl Freeze for DistanceInput
impl RefUnwindSafe for DistanceInput
impl Send for DistanceInput
impl Sync for DistanceInput
impl Unpin for DistanceInput
impl UnwindSafe for DistanceInput
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.