pub struct TraitPatternAnalyzer;Expand description
Analyzer for trait implementation patterns
Implementations§
Source§impl TraitPatternAnalyzer
impl TraitPatternAnalyzer
Sourcepub fn analyze_file(ast: &File) -> TraitPatternMetrics
pub fn analyze_file(ast: &File) -> TraitPatternMetrics
Analyze a file for trait implementation patterns
Returns metrics about trait implementations, method uniformity, and complexity.
Sourcepub fn calculate_method_uniformity(impl_blocks: &[ImplBlockInfo]) -> f64
pub fn calculate_method_uniformity(impl_blocks: &[ImplBlockInfo]) -> f64
Calculate percentage of implementations sharing the same methods
Returns a value between 0.0 and 1.0 indicating how uniform the method signatures are across all implementations.
Identify methods that appear in most implementations
Returns list of (method_name, frequency_percentage) tuples.
Auto Trait Implementations§
impl Freeze for TraitPatternAnalyzer
impl RefUnwindSafe for TraitPatternAnalyzer
impl Send for TraitPatternAnalyzer
impl Sync for TraitPatternAnalyzer
impl Unpin for TraitPatternAnalyzer
impl UnwindSafe for TraitPatternAnalyzer
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> 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