Macro create_buffer

Source
macro_rules! create_buffer {
    ($($val:expr),+) => { ... };
}
Expand description

Given a list of CompactEncoding things, create a zeroed buffer of the correct size for encoding. Note this is macro is useful when your arguments have differing types.

let foo: Ipv4Addr = "0.0.0.0".parse()?;
let bar = 42u64;
let qux = "hello?";
let buff = create_buffer!(foo, bar, qux);
assert_eq!(buff.len(), 12);