Skip to main content

Module stateful_predicate

Module stateful_predicate 

Source
Expand description

§StatefulPredicate Abstraction

Provides predicate wrappers for closures that implement FnMut(&T) -> bool. A stateful predicate can update its own internal state while testing borrowed input values.

Use Predicate for immutable Fn(&T) -> bool predicates and StatefulPredicate when the predicate needs native FnMut semantics, such as counters, rolling windows, sampling, or stateful filters.

Structs§

ArcStatefulPredicate
An Arc-based stateful predicate with thread-safe shared ownership.
BoxStatefulPredicate
A Box-based stateful predicate with single ownership.
RcStatefulPredicate
An Rc-based stateful predicate with single-threaded shared ownership.

Traits§

FnStatefulPredicateOps
Extension trait providing logical composition methods for stateful closures.
StatefulPredicate
A stateful predicate trait for testing values with mutable internal state.