pub struct PerformanceLinter { /* private fields */ }Expand description
AST-based performance linter for GUI/TUI applications
This linter analyzes code patterns that commonly cause performance issues in render/update paths.
§Usage
ⓘ
use fastui_cosmic::perf_lints::{PerformanceLinter, lint_codes::*};
let mut linter = PerformanceLinter::new();
linter.enable(EXPENSIVE_CLONE);
linter.enable(ALLOCATION_IN_LOOP);
linter.enable(SLOW_HASHER);
let issues = linter.lint_source(source_code);
for issue in issues {
println!("{}: {}", issue.code, issue.message);
}Implementations§
Source§impl PerformanceLinter
impl PerformanceLinter
Sourcepub fn enabled_rules(&self) -> &[&'static str]
pub fn enabled_rules(&self) -> &[&'static str]
Get list of enabled rules
Sourcepub fn is_enabled(&self, rule: &str) -> bool
pub fn is_enabled(&self, rule: &str) -> bool
Check if a rule is enabled
Source§impl PerformanceLinter
impl PerformanceLinter
Sourcepub fn lint_source(&self, source: &str) -> Vec<LintIssue>
pub fn lint_source(&self, source: &str) -> Vec<LintIssue>
Lint source code for performance issues
This performs simple pattern matching on the source code. For full AST-based linting, use a clippy integration.
Trait Implementations§
Source§impl Debug for PerformanceLinter
impl Debug for PerformanceLinter
Auto Trait Implementations§
impl Freeze for PerformanceLinter
impl RefUnwindSafe for PerformanceLinter
impl Send for PerformanceLinter
impl Sync for PerformanceLinter
impl Unpin for PerformanceLinter
impl UnsafeUnpin for PerformanceLinter
impl UnwindSafe for PerformanceLinter
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