pub struct Rules { /* private fields */ }Expand description
A checked rules file, or the built-in rules with a custom file merged
in (Rules::with_custom).
Implementations§
Source§impl Rules
impl Rules
Sourcepub fn parse(text: &str) -> Result<Rules, CoreError>
pub fn parse(text: &str) -> Result<Rules, CoreError>
Reads and checks a rules file: unsupported_schema for another
schema, parse_error for bad TOML or a pattern that does not
compile, invalid_value/missing_field/field_not_allowed for a
rule that breaks the format.
Sourcepub fn with_custom(&self, text: &str) -> Result<(Rules, Vec<String>), CoreError>
pub fn with_custom(&self, text: &str) -> Result<(Rules, Vec<String>), CoreError>
These rules with a custom rules file merged in: a rule with a new id is added; a rule with a built-in id may only raise that rule’s severity (its pattern is ignored, the built-in one keeps running). A built-in rule is never removed or lowered: such an entry is skipped with a warning (the returned messages).
Sourcepub fn fingerprint(&self) -> &str
pub fn fingerprint(&self) -> &str
SHA-256 (hex) of the rules text: part of the cache key.
pub fn rules(&self) -> &[Rule]
Trait Implementations§
Auto Trait Implementations§
impl Forget for Rules
impl Freeze for Rules
impl Move for Rules
impl RefUnwindSafe for Ruleswhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>: RefUnwindSafe,
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl UnsafeUnpin for Ruleswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Rule>: UnsafeUnpin,
impl UnwindSafe for Ruleswhere
RawVecInner: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: UnwindSafe,
Arc<str>: UnwindSafe,
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