13 个不稳定版本 (4 个重大变更)

0.5.4 2024 年 6 月 28 日
0.5.3 2024 年 5 月 21 日
0.5.0 2024 年 1 月 7 日
0.4.3 2023 年 10 月 31 日
0.1.0 2023 年 3 月 2 日

#263嵌入式开发

Download history 76/week @ 2024-04-21 31/week @ 2024-04-28 17/week @ 2024-05-05 235/week @ 2024-05-12 263/week @ 2024-05-19 34/week @ 2024-05-26 43/week @ 2024-06-02 40/week @ 2024-06-09 88/week @ 2024-06-16 240/week @ 2024-06-23 185/week @ 2024-06-30 115/week @ 2024-07-07 115/week @ 2024-07-14 124/week @ 2024-07-21 135/week @ 2024-07-28 184/week @ 2024-08-04

每月下载量 570
用于 reqwless

MIT/Apache

18KB
353

为 embedded-io 提供缓冲类型

CI crates.io docs.rs

buffered-io 包实现了 embedded-io/embedded-io-asyncReadWrite 特性。

示例

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
})

依赖项

~47KB