macro_rules! seq {
[$( $elem:expr ),*] => { ... };
[$len:literal # $( $elem:expr ),*] => { ... };
(@replace_expr ($_t:expr, $sub:expr)) => { ... };
(@count_tts $($e:expr),*) => { ... };
}
Expand description
Creates a sequence, similar to the vec!
macro.
It’s possible to create both Sequence
s and BoundedSequence
s.
Unbounded sequences are created by a comma-separated list of values.
Bounded sequences are created by additionally specifying the maximum capacity (the N
type
parameter) in the beginning, followed by a #
.
§Example
let unbounded: Sequence<i32> = seq![1, 2, 3];
let bounded: BoundedSequence<i32, 5> = seq![5 # 1, 2, 3];
assert_eq!(&unbounded[..], &bounded[..])