#io #error #subset #default #data #required #traits

no-std portable-io

“ A subset of Rust std::io functionality supported for no-std

4 releases

new 0.0.4 Jan 13, 2025
0.0.3 Jan 9, 2025
0.0.2 Dec 27, 2024
0.0.1 Dec 24, 2024
0.0.0 Nov 6, 2024

#829 in Rust patterns

Download history 56/week @ 2024-10-31 64/week @ 2024-11-07 5/week @ 2024-11-14 4/week @ 2024-11-21 1/week @ 2024-12-12 118/week @ 2024-12-19 198/week @ 2024-12-26 2/week @ 2025-01-02 240/week @ 2025-01-09

558 downloads per month

MIT/Apache

175KB
3K SLoC

portable-io

Crates.io Version Crates.io License

Traits, helpers, and type definitions for core I/O functionality. A subset from Rust std::io functionality supported for no-std.

MSRV:

  • stable: 1.81.0
  • nightly: nightly-2022-08-24

NOTE: unstable configuration --cfg portable_io_unstable_all in Rust flags is required for Rust nightly pre-2024-06-09 to enable error_in_core feature directive (stabilized in June 2024).

Features

  • alloc (enabled by default) - mandatory feature - for alloc-related functionality
  • os-error (unstable feature) - support raw OS errors - with some KNOWN PANICS due to MISSING FUNCTIONALITY
  • unix-iovec (unstable feature) - use iovec from libc for data stored in IoSlice & IoSliceMut

CFG options

  • portable_io_unstable_all - enable all unstable option(s):
    • size hint optimization for Read iterator - uses Rust unstable min_specialization feature

To enable: use --cfg portable_io_unstable_all in Rust flags, set RUSTFLAGS env variable when running cargo build or cargo test for example.

major TODO items

  • Resolve doc warnings
  • Include updates from newer versions of upstream Rust library code
  • Include & adapt some more documentation from upstream Rust library code
  • Resolve other TODO items in this code

license

MIT or Apache 2.0 license options

NOTE that this code is adapted from Rust std library code version 1.59.0 (last release version that did not require unstable macro feature to build error module)

Dependencies

~105–255KB