Macro chain
macro_rules! chain {
() => { ... };
($first:expr $(, $rest:expr )* $(,)?) => { ... };
}
Chain zero or more iterators together into one sequence.
The comma-separated arguments must implement IntoIterator.
The final argument may be followed by a trailing comma.
Examples
Empty invocations of chain! expand to an invocation of [std::iter::empty]:
use iter;
use chain;
let _: Empty = chain!;
let _: Empty = chain!;
Invocations of chain! with one argument expand to arg.into_iter():
use Range;
use chain;
let _: IntoIter = chain!; // trailing comma optional!
let _: IntoIter = chain!;
Invocations of chain! with multiple arguments .into_iter() each
argument, and then chain them together:
use ;
use ;
// e.g., this:
let with_macro: =
chain!;
// ...is equivalent to this:
let with_method: =
once
.chain
.chain;
assert_equal;