Skip to main content

buffer

Macro buffer 

Source
macro_rules! buffer {
    ($($x:expr),*) => { ... };
}
Expand description

Creates a Buffer containing the arguments.

buffer! allows creating buffers using the same syntax as the vec! macro. It simply creates a Vec and converts it to a Buffer.

§Examples

let buffer = buffer![1, 2, 3];
assert_eq!(&*buffer, &[1, 2, 3]);

let buffer = buffer![0; 5];
assert_eq!(&*buffer, &[0, 0, 0, 0, 0]);