[][src]Macro staticvec::staticvec

macro_rules! staticvec {
    (@put_one $val:expr) => { ... };
    ($val:expr; $n:expr) => { ... };
    ($($val:expr),* $(,)*) => { ... };
}

Creates a new StaticVec from a vec!-style pseudo-slice. The newly created StaticVec will have a capacity and length exactly equal to the number of elements in the slice. The "array-like" [value; N] syntax is also supported for types that implement Copy.

Example usage:

// The type of the StaticVec on the next line is `StaticVec<Vec<StaticVec<i32, 4>>, 1>`.
let v = staticvec![vec![staticvec![1, 2, 3, 4]]];
// The type of the StaticVec on the next line is `StaticVec<f32, 64>`.
let v2 = staticvec![12.0; 64];