#[non_exhaustive]pub struct LcomInput { /* private fields */ }Expand description
Immutable method/field incidence data used by every LCOM formula.
Implementations§
Source§impl LcomInput
impl LcomInput
Sourcepub fn new(fields: Vec<String>, method_field_accesses: Vec<Vec<String>>) -> Self
pub fn new(fields: Vec<String>, method_field_accesses: Vec<Vec<String>>) -> Self
Creates a formula input from declared fields and one accessed-field list per method.
Duplicate field names and duplicate accesses are removed. Accesses to undeclared fields are ignored so every formula uses one consistent method/field incidence relation.
Sourcepub fn from_type_info(type_info: &TypeInfo) -> Option<Self>
pub fn from_type_info(type_info: &TypeInfo) -> Option<Self>
Builds an input for an eligible Rust metrics type.
Only structs with at least one unambiguously associated inherent method are eligible. Trait impl methods are intentionally absent from the resulting method population.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of declared fields.
Sourcepub fn method_count(&self) -> usize
pub fn method_count(&self) -> usize
Returns the number of inherent methods represented by the input.
Sourcepub fn field_access_count(&self) -> usize
pub fn field_access_count(&self) -> usize
Returns the number of distinct method-to-declared-field accesses.
Trait Implementations§
impl Eq for LcomInput
impl StructuralPartialEq for LcomInput
Auto Trait Implementations§
impl Freeze for LcomInput
impl RefUnwindSafe for LcomInput
impl Send for LcomInput
impl Sync for LcomInput
impl Unpin for LcomInput
impl UnwindSafe for LcomInput
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.