devela::all

Macro format_buf

Source
macro_rules! format_buf {
    ($buf:expr, $($args:tt)*) => { ... };
}
Expand description

Returns a formatted str slice backed by a buffer, non-allocating.

It calls the format_buf_args function with the format_args macro.

§Example

let mut buf = [0u8; 64];
let s = format_buf![&mut buf, "Test: {} {}", "foo", 42];
assert_eq!(Ok("Test: foo 42"), s);

§Features

Makes use of the unsafe_str feature if enabled.