pub struct AlgaeSet<E> { /* private fields */ }
Expand description
A representation of a ZF set.
All elements must belong to a “supertype” E
. Subsets of the supertype are
determined by a given set of conditions (similar to the conditions used in
the set construction paradigm of traditional ZF set theory).
Element existence (ie. whether or not a certain element is a member of a
given set) is given through the has
function. Set
unions are given by the or
function, and set
intersections are given by the and
function.
§Examples
use algae_rs::algaeset::AlgaeSet;
let mut pos_floats = AlgaeSet::new(vec![
Box::new(|e: f32| e > 0_f32)
]);
assert!(pos_floats.has(12_f32));
let neg_floats = AlgaeSet::new(vec![
Box::new(|e: f32| e < 0_f32)
]);
pos_floats.or(neg_floats);
let all_floats = pos_floats;
assert!(all_floats.has(12_f32));
assert!(all_floats.has(-12_f32));
Implementations§
Source§impl<E> AlgaeSet<E>
impl<E> AlgaeSet<E>
Auto Trait Implementations§
impl<E> Freeze for AlgaeSet<E>
impl<E> !RefUnwindSafe for AlgaeSet<E>
impl<E> !Send for AlgaeSet<E>
impl<E> !Sync for AlgaeSet<E>
impl<E> Unpin for AlgaeSet<E>
impl<E> !UnwindSafe for AlgaeSet<E>
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