Macro devela::format_buf

source ·
macro_rules! format_buf {
    ($buf:expr, $($args:tt)*) => { ... };
}
Available on crate feature fmt only.
Expand description

Returns a formatted str slice backed by a buffer, no_std compatible.

It calls the format_buf_args function with the format_args macro.

Examples

use devela::format_buf;

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

assert_eq!(Ok("Test: foo 42"), s);