#buffer #const-generics #write #no-std

no-std e-write-buffer

A no_std, const-generic, core::fmt::Writeable buffer

7 releases (breaking)

0.6.1 Feb 20, 2024
0.6.0 Feb 20, 2024
0.5.0 May 10, 2021
0.4.0 Apr 14, 2021
0.1.0 Mar 27, 2021

#265 in Embedded development

47 downloads per month

MIT license

8KB
122 lines

MIT license Crates Released API docs

A no_std, no allocation, core::fmt::Writeable buffer.

Usage:

use e_write_buffer::WriteBuffer;
use std::fmt::Write as _;

fn main() {
    let mut buffer: WriteBuffer<20> = WriteBuffer::new();
    let x = 12;
    write!(buffer, "{}", x).unwrap();
    assert_eq!(buffer.as_str(), "12");
}

See also heapless::String as an alternative.


lib.rs:

A no_std, no allocation, core::fmt::Writeable buffer.

Usage:

use e_write_buffer::WriteBuffer;
use std::fmt::Write as _;

fn main() {
    let mut buffer: WriteBuffer<20> = WriteBuffer::new();
    let x = 12;
    write!(buffer, "{}", x).unwrap();
    assert_eq!(buffer.as_str(), "12");
}

No runtime deps