Content-Length: 7210 | pFad | https://doc.rust-lang.org/std/string/../../../../reference/items/../../core/macro.concat_bytes.html

concat_bytes in core - RustSkip to main content

concat_bytes

Macro concat_bytes 

Source
macro_rules! concat_bytes {
    ($($e:literal),+ $(,)?) => { ... };
}
🔬This is a nightly-only experimental API. (concat_bytes #87555)
Expand description

Concatenates literals into a byte slice.

This macro takes any number of comma-separated literals, and concatenates them all into one, yielding an expression of type &[u8; _], which represents all of the literals concatenated left-to-right. The literals passed can be any combination of:

  • byte literals (b'r')
  • byte strings (b"Rust")
  • arrays of bytes/numbers ([b'A', 66, b'C'])

§Examples

#![feature(concat_bytes)]

let s: &[u8; 6] = concat_bytes!(b'A', b"BC", [68, b'E', 70]);
assert_eq!(s, b"ABCDEF");








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../../../../reference/items/../../core/macro.concat_bytes.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy