MultiRuleLinter

Struct MultiRuleLinter 

Source
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

Source

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:

  1. Taking the document content immediately
  2. Parsing and initializing the context cache upfront
  3. Creating rule linters with pre-initialized context
  4. Making the linter ready for immediate use with analyze()

After calling analyze(), this linter instance should be discarded.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.