Crates.io | no_std_io |
lib.rs | no_std_io |
version | 0.6.0 |
source | src |
created_at | 2023-06-11 00:49:19.044722 |
updated_at | 2023-06-11 03:51:35.933058 |
description | The bare essentials of std::io for use in no_std. Alloc support is optional. |
homepage | |
repository | https://github.com/no-std-io/no-std-io |
max_upload_size | |
id | 887154 |
size | 160,732 |
no-std-io
is a fork of core2.
Ever wanted a Cursor
or the Error
trait in no_std
? Well now you can have it. A 'fork' of Rust's std
modules for no_std
environments, with the added benefit of optionally taking advantage of alloc
.
The goal of this crate is to provide a stable interface for building I/O and error trait functionality in
no_std
environments. The current code corresponds to the most recent stable API of Rust 1.56.0.
It is also a goal to achieve a true alloc-less experience, with opt-in alloc support.
This crate works on stable
with some limitations in functionality, and nightly
without limitations by adding
the relevant feature flag.
This crate is std
by default -- use no default features to get no_std
mode.
[dependencies]
no_std_io = "0.5"
Add the crate, use the things you would usually want from std::io
, but instead from no_std_io::io
, and
use no_std_io::error::Error
in place of std::error::Error
.
std
pass-throughs for the polyfilled types, but allows accessing the new typesRead
and Write
traits that require alloc
support (WIP)BufReader
and BufWriter
with const generic buffers.std::io
std::io::Error
, so we have our own copy without any Os
error functionsIoSlice
and the *_vectored
family of functions are not implemented.BufReader
and BufWriter
have a different signature, as they now use a const generic bounded array for the internal buffer. (Requires nightly feature)Other than items perhaps being entirely missing or certain functions unavailable on some traits, no function signatures have been changed.
copy
or the buffer types with std
support currently requires nightly due to the initializer
API.Licensed under either of
at your option.
Almost all of the code in this repository is a copy of the Rust language codebase with minor modifications.
For attributions, see https://thanks.rust-lang.org/.