pub struct MultiRuleLinter { /* private fields */ }Expand description
SINGLE-USE CONTRACT: MultiRuleLinter instances are designed for one-time use only.
Create a fresh MultiRuleLinter for each document you want to analyze using new_for_document().
After calling analyze(), the linter and all its rule instances should be discarded.
Implementations§
Source§impl MultiRuleLinter
impl MultiRuleLinter
Sourcepub fn new_for_document(
file_path: PathBuf,
config: QuickmarkConfig,
document: &str,
) -> Self
pub fn new_for_document( file_path: PathBuf, config: QuickmarkConfig, document: &str, ) -> Self
SINGLE-USE API ENFORCEMENT: Create a MultiRuleLinter bound to a specific document.
This constructor enforces the single-use contract by:
- Taking the document content immediately
- Parsing and initializing the context cache upfront
- Creating rule linters with pre-initialized context
- Making the linter ready for immediate use with
analyze()
After calling analyze(), this linter instance should be discarded.
Sourcepub fn analyze(&mut self) -> Vec<RuleViolation>
pub fn analyze(&mut self) -> Vec<RuleViolation>
Analyze the document that was provided during construction.
SINGLE-USE CONTRACT: This method should be called exactly once. After calling this method, the linter instance should be discarded.
Auto Trait Implementations§
impl Freeze for MultiRuleLinter
impl !RefUnwindSafe for MultiRuleLinter
impl !Send for MultiRuleLinter
impl !Sync for MultiRuleLinter
impl Unpin for MultiRuleLinter
impl !UnwindSafe for MultiRuleLinter
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