pub struct Permutations<T> { priv swaps: ElementSwaps, priv v: ~[T], }
An Iterator that uses ElementSwaps
to iterate through
all possible permutations of a vector.
The first iteration yields a clone of the vector as it is, then each successive element is the vector with one swap applied.
Generates even and odd permutations alternatingly.
impl<T: Clone> Iterator<~[T]> for Permutations<T>
fn next(&mut self) -> Option<~[T]>
Advance the iterator and return the next value. Return None
when the end is reached.
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).