#write #buffer #no-std #writable #ufmt #writebuf #uwrite

no-std writebuf-core

A writable buffer that implements fmt::Write or ufmt::uWrite

1 unstable release

0.1.0 Mar 20, 2023

#10 in #writable

MIT/Apache

5KB
84 lines

A writeable buffer that implements fmt::Write or ufmt::uWrite.

Example

use writebuf_core::WriteBuf;
use ufmt::{uwrite, uWrite};

// write to buffer
let mut buf: WriteBuf<10> = WriteBuf::from("123");
uwrite!(&mut buf, "{}", "456").ok();
uwrite!(&mut buf, "{}", 789).ok();
buf.write_str("0").ok();
buf.write_str("E").err();

// convert to ASCII string
buf.into_ascii_lossy().as_str();

ufmt

ufmt is more compact than core::fmt. By default, ufmt feature is enabled.

Dependencies

~2MB
~47K SLoC