pub struct BoxStatefulBiPredicate<T, U> { /* private fields */ }Expand description
A Box-based stateful bi-predicate with single ownership.
This type stores a Box<dyn FnMut(&T, &U) -> bool>, so each call may
update the predicate’s internal state. Composition methods consume self,
matching the single-ownership model.
Implementations§
Source§impl<T, U> BoxStatefulBiPredicate<T, U>
impl<T, U> BoxStatefulBiPredicate<T, U>
Sourcepub fn new<F>(f: F) -> Self
pub fn new<F>(f: F) -> Self
Creates a new bi-predicate.
Wraps the provided closure in the appropriate smart pointer type for this bi-predicate implementation.
Sourcepub fn new_with_name<F>(name: &str, f: F) -> Self
pub fn new_with_name<F>(name: &str, f: F) -> Self
Creates a new named bi-predicate.
Wraps the provided closure and assigns it a name, which is useful for debugging and logging purposes.
Sourcepub fn new_with_optional_name<F>(f: F, name: Option<String>) -> Self
pub fn new_with_optional_name<F>(f: F, name: Option<String>) -> Self
Creates a new named bi-predicate with an optional name.
Wraps the provided closure and assigns it an optional name.
Sourcepub fn clear_name(&mut self)
pub fn clear_name(&mut self)
Clears the name of this bi-predicate.
Sourcepub fn always_true() -> Self
pub fn always_true() -> Self
Creates a bi-predicate that always returns true.
§Returns
A new BoxStatefulBiPredicate that always returns true.
Sourcepub fn always_false() -> Self
pub fn always_false() -> Self
Creates a bi-predicate that always returns false.
§Returns
A new BoxStatefulBiPredicate that always returns false.
Sourcepub fn and<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
pub fn and<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
Sourcepub fn or<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
pub fn or<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
Sourcepub fn nand<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
pub fn nand<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
Sourcepub fn xor<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
pub fn xor<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
Sourcepub fn nor<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
pub fn nor<P>(self, other: P) -> BoxStatefulBiPredicate<T, U>where
P: StatefulBiPredicate<T, U> + 'static,
T: 'static,
U: 'static,
Trait Implementations§
Source§impl<T, U> Debug for BoxStatefulBiPredicate<T, U>
impl<T, U> Debug for BoxStatefulBiPredicate<T, U>
Source§impl<T, U> Display for BoxStatefulBiPredicate<T, U>
impl<T, U> Display for BoxStatefulBiPredicate<T, U>
Source§impl<T, U> Not for BoxStatefulBiPredicate<T, U>where
T: 'static,
U: 'static,
impl<T, U> Not for BoxStatefulBiPredicate<T, U>where
T: 'static,
U: 'static,
Source§impl<T, U> StatefulBiPredicate<T, U> for BoxStatefulBiPredicate<T, U>
impl<T, U> StatefulBiPredicate<T, U> for BoxStatefulBiPredicate<T, U>
Source§fn test(&mut self, first: &T, second: &U) -> bool
fn test(&mut self, first: &T, second: &U) -> bool
Source§fn into_box(self) -> BoxStatefulBiPredicate<T, U>
fn into_box(self) -> BoxStatefulBiPredicate<T, U>
BoxStatefulBiPredicate. Read moreSource§fn into_rc(self) -> RcStatefulBiPredicate<T, U>where
Self: 'static,
fn into_rc(self) -> RcStatefulBiPredicate<T, U>where
Self: 'static,
RcStatefulBiPredicate. Read more