Struct MD032

Source
pub struct MD032;
Expand description

MD032: Lists should be surrounded by blank lines

This rule checks that lists have blank lines before and after them, unless they are at the start or end of the document, or are nested within other lists.

Trait Implementations§

Source§

impl AstRule for MD032

Source§

fn id(&self) -> &'static str

Unique identifier for the rule (e.g., “MD001”)
Source§

fn name(&self) -> &'static str

Human-readable name for the rule (e.g., “heading-increment”)
Source§

fn description(&self) -> &'static str

Description of what the rule checks
Source§

fn metadata(&self) -> RuleMetadata

Metadata about this rule’s status and properties
Source§

fn check_ast<'a>( &self, document: &Document, ast: &'a AstNode<'a>, ) -> Result<Vec<Violation>>

Check a document using its AST
Source§

fn can_fix(&self) -> bool

Whether this rule can automatically fix violations
Source§

fn fix(&self, _content: &str, _violation: &Violation) -> Option<String>

Attempt to fix a violation (if supported)
Source§

fn create_violation( &self, message: String, line: usize, column: usize, severity: Severity, ) -> Violation

Create a violation for this rule

Auto Trait Implementations§

§

impl Freeze for MD032

§

impl RefUnwindSafe for MD032

§

impl Send for MD032

§

impl Sync for MD032

§

impl Unpin for MD032

§

impl UnwindSafe for MD032

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> Rule for T
where T: AstRule,

Source§

fn id(&self) -> &'static str

Unique identifier for the rule (e.g., “MD001”)
Source§

fn name(&self) -> &'static str

Human-readable name for the rule (e.g., “heading-increment”)
Source§

fn description(&self) -> &'static str

Description of what the rule checks
Source§

fn metadata(&self) -> RuleMetadata

Metadata about this rule’s status and properties
Source§

fn check_with_ast<'a>( &self, document: &Document, ast: Option<&'a Node<'a, RefCell<Ast>>>, ) -> Result<Vec<Violation>, MdBookLintError>

Check a document for violations of this rule with optional pre-parsed AST
Source§

fn check(&self, document: &Document) -> Result<Vec<Violation>, MdBookLintError>

Check a document for violations of this rule (backward compatibility)
Source§

fn can_fix(&self) -> bool

Whether this rule can automatically fix violations
Source§

fn fix(&self, content: &str, violation: &Violation) -> Option<String>

Attempt to fix a violation (if supported)
Source§

fn create_violation( &self, message: String, line: usize, column: usize, severity: Severity, ) -> Violation

Create a violation for this rule
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.