pub struct RuleEngine { /* private fields */ }Expand description
The rule engine: holds compiled rule-sets and an ordered list of rules.
Send + Sync, designed to be shared via Arc<RuleEngine>.
Implementations§
Source§impl RuleEngine
impl RuleEngine
Sourcepub fn match_request(&self, ctx: &MatchContext<'_>) -> &Action
pub fn match_request(&self, ctx: &MatchContext<'_>) -> &Action
Match a request against the rules and return the action to take.
Rules are evaluated in order; the first match wins. If no rule matches, the FINAL action is returned.
Sourcepub fn match_request_lazy_ip(&self, ctx: &MatchContext<'_>) -> MatchDecision<'_>
pub fn match_request_lazy_ip(&self, ctx: &MatchContext<'_>) -> MatchDecision<'_>
Try to match without an IP; if an IP-based rule appears before any
match, returns NeedIp so callers can resolve and retry.
Sourcepub fn has_ip_rules(&self) -> bool
pub fn has_ip_rules(&self) -> bool
Returns true if this engine has IP-based rules that may require DNS resolution.
Sourcepub fn rule_set_count(&self) -> usize
pub fn rule_set_count(&self) -> usize
Number of compiled rule-sets.
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Number of engine rules (including FINAL).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleEngine
impl RefUnwindSafe for RuleEngine
impl Send for RuleEngine
impl Sync for RuleEngine
impl Unpin for RuleEngine
impl UnsafeUnpin for RuleEngine
impl UnwindSafe for RuleEngine
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