pub struct ClassInfo {
pub name: String,
pub line: u32,
pub end_line: u32,
pub is_private: bool,
pub decorators: Vec<String>,
pub bases: Vec<String>,
pub is_enum: bool,
pub methods: Vec<(String, Vec<String>)>,
pub members: Vec<ClassMember>,
}Expand description
A class and, per method, the set of self.<attr> it touches — the input to
the LCOM* cohesion metric. Also carries member + base metadata for unused
class-member / unused enum-member detection.
Fields§
§name: String§line: u32§end_line: u32§is_private: boolTrue if this is private by convention (_Name).
decorators: Vec<String>Decorator paths on the class (dataclass, runtime_checkable, …).
bases: Vec<String>Base-class paths as written (Enum, enum.IntEnum, BaseModel, …).
is_enum: boolTrue if a base resolves to an enum-family class (Enum/IntEnum/…).
methods: Vec<(String, Vec<String>)>(method_name, set-of-instance-attributes-it-references).
members: Vec<ClassMember>Declared members: methods and class-level attribute/constant assignments.
Trait Implementations§
impl Eq for ClassInfo
impl StructuralPartialEq for ClassInfo
Auto Trait Implementations§
impl Freeze for ClassInfo
impl RefUnwindSafe for ClassInfo
impl Send for ClassInfo
impl Sync for ClassInfo
impl Unpin for ClassInfo
impl UnsafeUnpin for ClassInfo
impl UnwindSafe for ClassInfo
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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