pub struct PredicateSet<T>{ /* private fields */ }Expand description
A set defined by a predicate.
Instead of explicitly storing elements, a predicate set determines membership by evaluating a condition.
This is useful for representing infinite or dynamically-defined sets, such as:
- All even numbers
- All positive numbers
- All values greater than 10
§Examples
use mathrc::PredicateSet;
let positive = PredicateSet::new(|x| x > 0.0);
assert!(positive.contains(5.0));
assert!(!positive.contains(-5.0));Implementations§
Source§impl<T> PredicateSet<T>
impl<T> PredicateSet<T>
Sourcepub fn is_subset(&self, _other: Self) -> bool
👎Deprecated
pub fn is_subset(&self, _other: Self) -> bool
Determines whether this set is a subset of another predicate set.
§Deprecated
Predicate-defined sets generally cannot be compared for subset relationships without additional mathematical constraints or a finite domain of evaluation.
This method currently returns false unconditionally and should
not be used.
Trait Implementations§
Source§impl<T> Clone for PredicateSet<T>
impl<T> Clone for PredicateSet<T>
Source§fn clone(&self) -> PredicateSet<T>
fn clone(&self) -> PredicateSet<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for PredicateSet<T>where
T: Freeze,
impl<T> RefUnwindSafe for PredicateSet<T>where
T: RefUnwindSafe,
impl<T> Send for PredicateSet<T>where
T: Send,
impl<T> Sync for PredicateSet<T>where
T: Sync,
impl<T> Unpin for PredicateSet<T>where
T: Unpin,
impl<T> UnsafeUnpin for PredicateSet<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for PredicateSet<T>where
T: UnwindSafe,
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