pub enum Inclusion<T> {
Left(T),
Both(T, T),
Right(T),
}
Expand description
The sets an element is included in.
Variants§
Implementations§
Source§impl<T> Inclusion<T>
impl<T> Inclusion<T>
Sourcepub fn union(self) -> T
pub fn union(self) -> T
Return the element, whichever set it is in. If it is in both sets, the left element is returned.
Sourcepub fn intersection(self) -> Option<T>
pub fn intersection(self) -> Option<T>
Return the element if it is in both sets. The left element is returned.
Sourcepub fn difference(self) -> Option<T>
pub fn difference(self) -> Option<T>
Return the element if it is in the left set.
Sourcepub fn symmetric_difference(self) -> Option<T>
pub fn symmetric_difference(self) -> Option<T>
Return the element if it is in exactly one set.
Trait Implementations§
impl<T: Copy> Copy for Inclusion<T>
impl<T: Eq> Eq for Inclusion<T>
impl<T> StructuralPartialEq for Inclusion<T>
Auto Trait Implementations§
impl<T> Freeze for Inclusion<T>where
T: Freeze,
impl<T> RefUnwindSafe for Inclusion<T>where
T: RefUnwindSafe,
impl<T> Send for Inclusion<T>where
T: Send,
impl<T> Sync for Inclusion<T>where
T: Sync,
impl<T> Unpin for Inclusion<T>where
T: Unpin,
impl<T> UnwindSafe for Inclusion<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