Crates.io | bare-io |
lib.rs | bare-io |
version | 0.2.1 |
source | src |
created_at | 2020-10-10 21:38:39.439511 |
updated_at | 2020-10-11 16:07:59.708178 |
description | The bare essentials of std::io for use in no_std. Alloc support is optional. |
homepage | |
repository | https://github.com/bbqsrc/bare-io |
max_upload_size | |
id | 298176 |
size | 135,555 |
Ever wanted a Cursor
in no_std
? Well now you can have it. A 'fork' of Rust's std::io
module for no_std
environments,
with the added benefit of not needing alloc
.
The goal of this crate is to provide a stable interface for building I/O trait functionality in
no_std
environments. The current code corresponds to the most recent stable API of Rust 1.47.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 no_std
by default — you must opt into enabling std
if required.
[dependencies]
bare-io = "0.2"
Add the crate, use the things you would usually want from std::io
, but instead from bare_io
.
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
with nightly-only featuresstd::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.All of the below are works in progress, but should help with demonstrating how to use this crate.
u64
type with no-std reader support with bare-io
byteorder
cratezstd
crate to demonstrate bare-io
in a more complex settingserde
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/.