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 is the result of all of the literals and expressions concatenated left-to-right. Literals are first converted using std::concat_bytes!. Finally, each expression is concatenated using concat_slices!.

See the crate documentation for examples.

§Stability note

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

#![feature(concat_bytes)]

§Differences to std

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'].