pub struct GuardRuleSet { /* private fields */ }Expand description
The Guard rule files an engine was configured with, parsed once at construction so a syntax error fails engine construction rather than every later validation.
Implementations§
Source§impl GuardRuleSet
impl GuardRuleSet
Sourcepub fn compile(sources: &[ExternalRuleSource]) -> Result<Option<Self>, String>
pub fn compile(sources: &[ExternalRuleSource]) -> Result<Option<Self>, String>
Parses every source, or returns None when there are none so an engine
can skip Guard evaluation entirely.
Sourcepub fn rule_metadata(&self) -> &HashMap<String, RuleMetadataEntry>
pub fn rule_metadata(&self) -> &HashMap<String, RuleMetadataEntry>
Metadata for every loaded Guard rule, keyed by rule name, in the form the rule listing and enrichment consume.
Sourcepub fn evaluate(
&self,
model: &SemanticModel,
) -> Result<Vec<Diagnostic>, ValidationError>
pub fn evaluate( &self, model: &SemanticModel, ) -> Result<Vec<Diagnostic>, ValidationError>
Evaluates every rule file against the authored template and reports one diagnostic per failed check. An evaluation failure is an error, never a diagnostic, because it describes a problem with the rules rather than with the template.
Trait Implementations§
Source§impl Clone for GuardRuleSet
impl Clone for GuardRuleSet
Source§fn clone(&self) -> GuardRuleSet
fn clone(&self) -> GuardRuleSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GuardRuleSet
impl RefUnwindSafe for GuardRuleSet
impl Send for GuardRuleSet
impl Sync for GuardRuleSet
impl Unpin for GuardRuleSet
impl UnsafeUnpin for GuardRuleSet
impl UnwindSafe for GuardRuleSet
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