pub struct StructInitPattern {
pub struct_name: String,
pub field_count: usize,
pub function_lines: usize,
pub initialization_lines: usize,
pub initialization_ratio: f64,
pub avg_nesting_depth: f64,
pub max_nesting_depth: usize,
pub field_dependencies: Vec<FieldDependency>,
pub complex_fields: Vec<String>,
pub cyclomatic_complexity: usize,
pub is_result_wrapped: bool,
pub calls_constructors: bool,
}Expand description
Detected struct initialization pattern
Fields§
§struct_name: StringName of struct being initialized
field_count: usizeNumber of fields in struct literal
function_lines: usizeTotal lines in function
initialization_lines: usizeLines dedicated to field initialization
initialization_ratio: f64Ratio of initialization to total lines (0.0 - 1.0)
avg_nesting_depth: f64Average nesting depth across initialization
max_nesting_depth: usizeMaximum nesting depth encountered
field_dependencies: Vec<FieldDependency>Field dependencies (which fields reference others)
complex_fields: Vec<String>Fields requiring >10 lines of logic
cyclomatic_complexity: usizeCyclomatic complexity (for comparison/context)
is_result_wrapped: boolWhether function wraps result in Result<T>
calls_constructors: boolWhether initialization calls other constructors
Trait Implementations§
Source§impl Clone for StructInitPattern
impl Clone for StructInitPattern
Source§fn clone(&self) -> StructInitPattern
fn clone(&self) -> StructInitPattern
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 StructInitPattern
impl Debug for StructInitPattern
Source§impl<'de> Deserialize<'de> for StructInitPattern
impl<'de> Deserialize<'de> for StructInitPattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StructInitPattern
impl PartialEq for StructInitPattern
Source§impl Serialize for StructInitPattern
impl Serialize for StructInitPattern
impl StructuralPartialEq for StructInitPattern
Auto Trait Implementations§
impl Freeze for StructInitPattern
impl RefUnwindSafe for StructInitPattern
impl Send for StructInitPattern
impl Sync for StructInitPattern
impl Unpin for StructInitPattern
impl UnwindSafe for StructInitPattern
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