pub struct ExplainableGenerator { /* private fields */ }Expand description
Explainable rule generator
Implementations§
Source§impl ExplainableGenerator
impl ExplainableGenerator
Sourcepub fn register_rule(&mut self, rule: Rule, description: impl Into<String>)
pub fn register_rule(&mut self, rule: Rule, description: impl Into<String>)
Register a rule with simple description
Sourcepub fn register_rule_with_metadata(
&mut self,
rule: Rule,
metadata: RuleMetadata,
)
pub fn register_rule_with_metadata( &mut self, rule: Rule, metadata: RuleMetadata, )
Register a rule with full metadata
Sourcepub fn explain(
&mut self,
rule_name: &str,
explanation_type: ExplanationType,
) -> Option<String>
pub fn explain( &mut self, rule_name: &str, explanation_type: ExplanationType, ) -> Option<String>
Get explanation for a rule
Sourcepub fn get_feature_contributions(
&self,
rule_name: &str,
) -> Vec<FeatureContribution>
pub fn get_feature_contributions( &self, rule_name: &str, ) -> Vec<FeatureContribution>
Get feature contributions
Sourcepub fn get_metadata(&self, rule_name: &str) -> Option<&RuleMetadata>
pub fn get_metadata(&self, rule_name: &str) -> Option<&RuleMetadata>
Get rule metadata
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear cache
Sourcepub fn remove_rule(&mut self, rule_name: &str) -> bool
pub fn remove_rule(&mut self, rule_name: &str) -> bool
Remove rule
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExplainableGenerator
impl RefUnwindSafe for ExplainableGenerator
impl Send for ExplainableGenerator
impl Sync for ExplainableGenerator
impl Unpin for ExplainableGenerator
impl UnsafeUnpin for ExplainableGenerator
impl UnwindSafe for ExplainableGenerator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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