pub struct RuleEngineBuilder { /* private fields */ }Expand description
Builder for constructing a RuleEngine.
Implementations§
Source§impl RuleEngineBuilder
impl RuleEngineBuilder
Sourcepub fn set_geoip(&mut self, matcher: Arc<GeoipMatcher>) -> &mut Self
pub fn set_geoip(&mut self, matcher: Arc<GeoipMatcher>) -> &mut Self
Set the GeoIP matcher for GEOIP rule matching.
Sourcepub fn add_rule_set(
&mut self,
name: impl Into<String>,
rules: Vec<ParsedRule>,
) -> &mut Self
pub fn add_rule_set( &mut self, name: impl Into<String>, rules: Vec<ParsedRule>, ) -> &mut Self
Add a named rule-set (parsed rules).
Sourcepub fn add_rule_set_rule(
&mut self,
rule_set_name: impl Into<String>,
action: Action,
) -> &mut Self
pub fn add_rule_set_rule( &mut self, rule_set_name: impl Into<String>, action: Action, ) -> &mut Self
Add a rule that references a named rule-set.
Sourcepub fn add_geoip_rule(
&mut self,
code: impl Into<String>,
action: Action,
) -> &mut Self
pub fn add_geoip_rule( &mut self, code: impl Into<String>, action: Action, ) -> &mut Self
Add a GEOIP rule.
Sourcepub fn add_inline_rule(&mut self, rule: ParsedRule, action: Action) -> &mut Self
pub fn add_inline_rule(&mut self, rule: ParsedRule, action: Action) -> &mut Self
Add an inline rule (single rule type + value).
Sourcepub fn build(self) -> Result<RuleEngine, RulesError>
pub fn build(self) -> Result<RuleEngine, RulesError>
Build the rule engine.
Trait Implementations§
Source§impl Debug for RuleEngineBuilder
impl Debug for RuleEngineBuilder
Auto Trait Implementations§
impl Freeze for RuleEngineBuilder
impl RefUnwindSafe for RuleEngineBuilder
impl Send for RuleEngineBuilder
impl Sync for RuleEngineBuilder
impl Unpin for RuleEngineBuilder
impl UnsafeUnpin for RuleEngineBuilder
impl UnwindSafe for RuleEngineBuilder
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