Difference

Struct Difference 

Source
pub struct Difference<T, U>(pub T, pub U);
Expand description

Bit-set wrapper that acts like set complement.

Effectively inverses all bits in the underlying bit-set.

Tuple Fields§

§0: T§1: U

Trait Implementations§

Source§

impl<T, U> BitComplement for Difference<T, U>
where T: BitComplement,

Source§

impl<T, U, Y> BitDifference<Y> for Difference<T, U>
where T: BitDifference<Y>,

Source§

type Output = Difference<<T as BitDifference<Y>>::Output, U>

Source§

fn difference(self, rhs: Y) -> Self::Output

Returns bit-set has bits set for each index that has bit set in exactly one of two arguments.
Source§

impl<T, U> BitEmpty for Difference<T, U>
where T: BitEmpty, U: Default,

Source§

fn empty() -> Self

Returns empty bitset for which all bits are unset.
Source§

impl<T, U> BitFull for Difference<T, U>
where T: BitFull, U: BitEmpty,

Source§

fn full() -> Self

Returns full bitset for which all bits are set.
Source§

impl<T, U, Y> BitIntersection<Y> for Difference<T, U>
where T: BitIntersection<Y>,

Source§

type Output = Difference<<T as BitIntersection<Y>>::Output, U>

Source§

fn intersection(self, rhs: Y) -> Self::Output

Returns bit-set with bits set for each index that has bit set in either of two arguments.
Source§

impl<T, U> BitSearch for Difference<T, U>
where T: BitSearch, U: BitTest,

Source§

fn find_first_set(&self, lower_bound: usize) -> Option<usize>

Searches for first bit set starting with lower_bound. Returns index of first bit set. Read more
Source§

fn find_set_in_range<R>(&self, range: R) -> Option<usize>
where R: RangeBounds<usize>,

Searches for bit set specified range. Returns index of bit set. Read more
Source§

impl<T, U> BitSet for Difference<T, U>
where T: BitSet, U: BitUnset,

Source§

unsafe fn set_unchecked(&mut self, idx: usize)

Set bit at specified index. Read more
Source§

fn set(&mut self, idx: usize)

Sets bit at specified index. Read more
Source§

impl<T, U> BitSetLimit for Difference<T, U>

Source§

const MAX_SET_INDEX: usize

Largest possible bit index that can be set. Any larger index will always be unset. Setting larger index is now allowed. Read more
Source§

impl<T, U> BitTest for Difference<T, U>
where T: BitTest, U: BitTest,

Source§

fn test(&self, idx: usize) -> bool

Tests if bit at specified index is set.
Source§

impl<T, U> BitTestAll for Difference<T, U>
where T: BitTestAll, U: BitTestNone,

Source§

fn test_all(&self) -> bool

Tests if all bits are set.
Source§

impl<T, U> BitTestNone for Difference<T, U>
where T: BitSubset<U>,

Source§

fn test_none(&self) -> bool

Tests if none bits is set.
Source§

impl<T, U, Y> BitUnion<Y> for Difference<T, U>

Source§

type Output = Union<Difference<T, U>, Y>

Source§

fn union(self, rhs: Y) -> Self::Output

Returns bit-set with bits set for each index that has bit set in both of two arguments.
Source§

impl<T, U> BitUnset for Difference<T, U>
where T: BitUnset, U: BitSet,

Source§

unsafe fn unset_unchecked(&mut self, idx: usize)

Unsets bit at specified index. Read more
Source§

fn unset(&mut self, idx: usize)

Unsets bit at specified index. Read more
Source§

impl<T, U> BitUnsetLimit for Difference<T, U>

Source§

const MAX_UNSET_INDEX: usize

Largest possible bit index that can be unset. Any larger index will always be set. Unsetting larger index is now allowed. Read more
Source§

impl<T: Clone, U: Clone> Clone for Difference<T, U>

Source§

fn clone(&self) -> Difference<T, U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, U: Debug> Debug for Difference<T, U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, U: Default> Default for Difference<T, U>

Source§

fn default() -> Difference<T, U>

Returns the “default value” for a type. Read more
Source§

impl<T, U> Display for Difference<T, U>
where T: Display, U: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Hash, U: Hash> Hash for Difference<T, U>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: PartialEq, U: PartialEq> PartialEq for Difference<T, U>

Source§

fn eq(&self, other: &Difference<T, U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Copy, U: Copy> Copy for Difference<T, U>

Source§

impl<T: Eq, U: Eq> Eq for Difference<T, U>

Source§

impl<T, U> StructuralPartialEq for Difference<T, U>

Auto Trait Implementations§

§

impl<T, U> Freeze for Difference<T, U>
where T: Freeze, U: Freeze,

§

impl<T, U> RefUnwindSafe for Difference<T, U>

§

impl<T, U> Send for Difference<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for Difference<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for Difference<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for Difference<T, U>
where T: UnwindSafe, U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.