13 unstable releases (4 breaking)

0.5.4 Jun 28, 2024
0.5.3 May 21, 2024
0.5.0 Jan 7, 2024
0.4.3 Oct 31, 2023
0.1.0 Mar 2, 2023

#338 in Embedded development

Download history 119/week @ 2024-07-11 112/week @ 2024-07-18 125/week @ 2024-07-25 172/week @ 2024-08-01 224/week @ 2024-08-08 173/week @ 2024-08-15 136/week @ 2024-08-22 146/week @ 2024-08-29 199/week @ 2024-09-05 191/week @ 2024-09-12 129/week @ 2024-09-19 224/week @ 2024-09-26 170/week @ 2024-10-03 241/week @ 2024-10-10 167/week @ 2024-10-17 110/week @ 2024-10-24

709 downloads per month
Used in 2 crates (via reqwless)

MIT/Apache

18KB
353 lines

Buffer Types for embedded-io

CI crates.io docs.rs

The buffered-io crate implements buffering for the embedded-io/embedded-io-async Read and Write traits.

Example

tokio_test::block_on(async {
    use buffered_io::asynch::BufferedWrite;
    use embedded_io_async::Write;
    
    let uart_tx = Vec::new(); // The underlying uart peripheral implementing Write to where buffered bytes are written
    let mut write_buf = [0; 120];
    let mut buffering = BufferedWrite::new(uart_tx, &mut write_buf);
    buffering.write(b"hello").await.unwrap(); // This write is buffered
    buffering.write(b" ").await.unwrap(); // This write is also buffered
    buffering.write(b"world").await.unwrap(); // This write is also buffered
    buffering.flush().await.unwrap(); // The string "hello world" is written to uart in one write
})

Dependencies

~47KB