[−][src]Trait permutator::Combination
Create a combination out of T
Normally, it take a [T]
or Vec<T>
to create a combination.
Example
use permutator::Combination; let data = [1, 2, 3, 4, 5]; data.combination(3).for_each(|c| { // called multiple times. // Each call have [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4] // [1, 2, 5], [1, 3, 5], [2, 3, 5], [1, 4, 5], [2, 4, 5], // and [3, 4, 5] respectively. println!("{:?}", c); });
See Example implementation on foreign type.
Associated Types
type Combinator: Iterator
Required methods
fn combination(&'a self, k: usize) -> Self::Combinator
Create a family of LargeCombinationIterator
of k
size out of self
.
See LargeCombinationIterator for
how to use LargeCombinationIterator
Return
A new family of LargeCombinationIterator
Implementations on Foreign Types
impl<'a, T> Combination<'a> for [T] where
T: 'a,
[src]
T: 'a,
An implementation for convenient use of LargeCombinationIterator
type Combinator = LargeCombinationIterator<'a, T>
ⓘImportant traits for LargeCombinationIterator<'a, T>fn combination(&'a self, k: usize) -> LargeCombinationIterator<'a, T>
[src]
ⓘImportant traits for LargeCombinationIterator<'a, T>
impl<'a, T> Combination<'a> for Vec<T> where
T: 'a,
[src]
T: 'a,
An implementation for convenient use of LargeCombinationIterator
type Combinator = LargeCombinationIterator<'a, T>
ⓘImportant traits for LargeCombinationIterator<'a, T>fn combination(&'a self, k: usize) -> LargeCombinationIterator<'a, T>
[src]
ⓘImportant traits for LargeCombinationIterator<'a, T>
Implementors
impl<'a, 'b: 'a, T> Combination<'a> for CombinationIntoCellParams<'b, T>
[src]
An implementation for convenient use of LargeCombinationCellIter
type Combinator = LargeCombinationCellIter<'b, T>
ⓘImportant traits for LargeCombinationCellIter<'a, T>fn combination(&'a self, k: usize) -> LargeCombinationCellIter<'b, T>
[src]
ⓘImportant traits for LargeCombinationCellIter<'a, T>
impl<'a, 'b: 'a, T> Combination<'a> for CombinationIntoRefParams<'b, T>
[src]
An implementation for convenient use of LargeCombinationRefIter
Warning
It hid unsafe object instantiation of LargeCombinationRefIter from user but all unsafe conditions are still applied as long as the life of object itself.
type Combinator = LargeCombinationRefIter<'b, T>
ⓘImportant traits for LargeCombinationRefIter<'a, T>fn combination(&'a self, k: usize) -> LargeCombinationRefIter<'b, T>
[src]
ⓘImportant traits for LargeCombinationRefIter<'a, T>