pub struct Reduce<Op, S, Cache> { /* private fields */ }
Expand description

Bitsets iterator reduction, as lazy bitset.

Constructed by reduce and reduce_w_cache.

Implementations§

source§

impl<Op, S, Cache> Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source

pub fn block_iter<'a>(&'a self) -> CachingBlockIter<&'a Self>

source

pub fn iter<'a>(&'a self) -> CachingIndexIter<&'a Self>

source

pub fn contains(&self, index: usize) -> bool

source

pub fn is_empty(&self) -> bool

Trait Implementations§

source§

impl<Op, S, Cache, Rhs> BitAnd<Rhs> for &Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn bitand(self, rhs: Rhs) -> Self::Output

Returns intersection of self and rhs bitsets.

§

type Output = Apply<And, &Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the & operator.
source§

impl<Op, S, Cache, Rhs> BitAnd<Rhs> for Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn bitand(self, rhs: Rhs) -> Self::Output

Returns intersection of self and rhs bitsets.

§

type Output = Apply<And, Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the & operator.
source§

impl<Op, S, Cache, Rhs> BitOr<Rhs> for &Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn bitor(self, rhs: Rhs) -> Self::Output

Returns union of self and rhs bitsets.

§

type Output = Apply<Or, &Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the | operator.
source§

impl<Op, S, Cache, Rhs> BitOr<Rhs> for Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn bitor(self, rhs: Rhs) -> Self::Output

Returns union of self and rhs bitsets.

§

type Output = Apply<Or, Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the | operator.
source§

impl<Op, S, Cache> BitSetBase for Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: LevelMasks,

source§

const TRUSTED_HIERARCHY: bool = _

true if S and Op are TrustedHierarchy.

§

type Conf = <<S as Iterator>::Item as BitSetBase>::Conf

source§

impl<Op, S, Cache> BitSetInterface for &Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

impl<Op, S, Cache> BitSetInterface for Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

impl<Op, S, Cache, Rhs> BitXor<Rhs> for &Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn bitxor(self, rhs: Rhs) -> Self::Output

Returns symmetric difference of self and rhs bitsets.

§

type Output = Apply<Xor, &Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the ^ operator.
source§

impl<Op, S, Cache, Rhs> BitXor<Rhs> for Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn bitxor(self, rhs: Rhs) -> Self::Output

Returns symmetric difference of self and rhs bitsets.

§

type Output = Apply<Xor, Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the ^ operator.
source§

impl<Op: Clone, S: Clone, Cache: Clone> Clone for Reduce<Op, S, Cache>

source§

fn clone(&self) -> Reduce<Op, S, Cache>

Returns a copy 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<Op, S, Cache> Debug for Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

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

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

impl<Op, S, Cache> IntoIterator for &Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

§

type Item = usize

The type of the elements being iterated over.
§

type IntoIter = CachingIndexIter<&Reduce<Op, S, Cache>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<Op, S, Cache> IntoIterator for Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

§

type Item = usize

The type of the elements being iterated over.
§

type IntoIter = CachingIndexIter<Reduce<Op, S, Cache>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<Op, S, Cache> LevelMasks for Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: LevelMasks,

source§

fn level0_mask(&self) -> <Self::Conf as Config>::Level0BitBlock

source§

unsafe fn level1_mask( &self, level0_index: usize ) -> <Self::Conf as Config>::Level1BitBlock

Safety Read more
source§

unsafe fn data_mask( &self, level0_index: usize, level1_index: usize ) -> <Self::Conf as Config>::DataBitBlock

Safety Read more
source§

impl<Op, S, Cache> LevelMasksIterExt for Reduce<Op, S, Cache>

§

type IterState = <<Cache as ReduceCache>::Impl<Op, S> as ReduceCacheImpl>::IterState

Consists from child states (if any) + Self state. Read more
§

type Level1BlockData = <<Cache as ReduceCache>::Impl<Op, S> as ReduceCacheImpl>::Level1BlockData

Level1 block related data, used to speed up data_mask access. Read more
source§

fn make_iter_state(&self) -> Self::IterState

source§

unsafe fn drop_iter_state(&self, state: &mut ManuallyDrop<Self::IterState>)

Having separate function for drop not strictly necessary, since IterState can actually drop itself. But! This allows not to store cache size within IterState. Which makes FixedCache CacheData ZST, if its childs are ZSTs, and which makes cache construction and destruction noop. Which is important for short iteration sessions. Read more
source§

unsafe fn init_level1_block_data( &self, state: &mut Self::IterState, level1_block_data: &mut MaybeUninit<Self::Level1BlockData>, level0_index: usize ) -> (<Self::Conf as Config>::Level1BitBlock, bool)

Init level1_block_data and return (Level1Mask, is_not_empty). Read more
source§

unsafe fn data_mask_from_block_data( level1_blocks: &Self::Level1BlockData, level1_index: usize ) -> <Self::Conf as Config>::DataBitBlock

Safety Read more
source§

impl<Op, S, Cache, Rhs> PartialEq<Rhs> for Reduce<Op, S, Cache>
where Rhs: LevelMasksIterExt<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

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

Works faster with TRUSTED_HIERARCHY.

1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Op, S, Cache, Rhs> Sub<Rhs> for &Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn sub(self, rhs: Rhs) -> Self::Output

Returns difference of self and rhs bitsets.

Or relative complement of rhs in self.

§

type Output = Apply<Sub, &Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the - operator.
source§

impl<Op, S, Cache, Rhs> Sub<Rhs> for Reduce<Op, S, Cache>
where Rhs: BitSetInterface<Conf = <Self as BitSetBase>::Conf>, Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

source§

fn sub(self, rhs: Rhs) -> Self::Output

Returns difference of self and rhs bitsets.

Or relative complement of rhs in self.

§

type Output = Apply<Sub, Reduce<Op, S, Cache>, Rhs>

The resulting type after applying the - operator.
source§

impl<Op, S, Cache> Eq for Reduce<Op, S, Cache>
where Op: BitSetOp, S: Iterator + Clone, S::Item: BitSetInterface, Cache: ReduceCache,

Auto Trait Implementations§

§

impl<Op, S, Cache> RefUnwindSafe for Reduce<Op, S, Cache>

§

impl<Op, S, Cache> Send for Reduce<Op, S, Cache>
where Cache: Send, Op: Send, S: Send,

§

impl<Op, S, Cache> Sync for Reduce<Op, S, Cache>
where Cache: Sync, Op: Sync, S: Sync,

§

impl<Op, S, Cache> Unpin for Reduce<Op, S, Cache>
where Cache: Unpin, Op: Unpin, S: Unpin,

§

impl<Op, S, Cache> UnwindSafe for Reduce<Op, S, Cache>
where Cache: UnwindSafe, Op: UnwindSafe, S: 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> 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,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.