pub struct RuleRegistry {
pub rule_schemas: BTreeMap<String, Map<String, Value>>,
pub rule_aliases: BTreeMap<String, HashMap<String, String>>,
}Expand description
Registry of all known rules and their config schemas
Fields§
§rule_schemas: BTreeMap<String, Map<String, Value>>Map of rule name (e.g. “MD013”) to set of valid config keys and their TOML value types
rule_aliases: BTreeMap<String, HashMap<String, String>>Map of rule name to config key aliases
Implementations§
Source§impl RuleRegistry
impl RuleRegistry
Sourcepub fn from_rules(rules: &[Box<dyn Rule>]) -> Self
pub fn from_rules(rules: &[Box<dyn Rule>]) -> Self
Build a registry from a list of rules
Sourcepub fn rule_names(&self) -> BTreeSet<String>
pub fn rule_names(&self) -> BTreeSet<String>
Get all known rule names
Sourcepub fn config_keys_for(&self, rule: &str) -> Option<BTreeSet<String>>
pub fn config_keys_for(&self, rule: &str) -> Option<BTreeSet<String>>
Get the valid configuration keys for a rule, including both original and normalized variants
Sourcepub fn expected_value_for(&self, rule: &str, key: &str) -> Option<&Value>
pub fn expected_value_for(&self, rule: &str, key: &str) -> Option<&Value>
Get the expected value type for a rule’s configuration key, trying variants
Sourcepub fn resolve_rule_name(&self, name: &str) -> Option<String>
pub fn resolve_rule_name(&self, name: &str) -> Option<String>
Resolve any rule name (canonical or alias) to its canonical form Returns None if the rule name is not recognized
Resolution order:
- Direct canonical name match
- Static aliases (built-in markdownlint aliases)
Auto Trait Implementations§
impl Freeze for RuleRegistry
impl RefUnwindSafe for RuleRegistry
impl Send for RuleRegistry
impl Sync for RuleRegistry
impl Unpin for RuleRegistry
impl UnwindSafe for RuleRegistry
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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