macro_rules! concat_bytes {
    ($($e:expr),* $(,)?) => { ... };
}
Expand description

Concatenate const &[u8] expressions and literals into a static byte slice.

This macro takes any number of comma-separated literals or constant expressions and yields an expression of type &'static [u8] which represents all of the literals and expressions concatenated left-to-right. Literals are converted using core::concat_bytes! and then each expression is concatenated using concat_slices!.

See the crate documentation for examples.

Stability note

🔬 This macro uses a nightly-only experimental API, core::concat_bytes, for processing byte literals, until it is stabilized you will need to add the following to the root of your crate.

#![feature(concat_bytes)]

Unlike the standard library macro this macro does not accept byte array literals directly like [b'A', 32, b'B'] instead you have to pass a slice like &[b'A', 32, b'B'].