You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

6
8
7
-
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,
8
-
with the added benefit of not needing `alloc`.
9
+
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`.
9
10
10
-
The goal of this crate is to provide a stable interface for building I/O trait functionality in
11
+
The goal of this crate is to provide a stable interface for building I/O and error trait functionality in
11
12
`no_std` environments. The current code corresponds to the most recent stable API of Rust 1.47.0.
12
13
It is also a goal to achieve a true alloc-less experience, with opt-in alloc support.
13
14
14
15
This crate works on `stable` with some limitations in functionality, and `nightly` without limitations by adding
15
16
the relevant feature flag.
16
17
17
-
This crate is `no_std` by default — you must opt into enabling `std` if required.
18
+
This crate is `std` by default -- use no default features to get `no_std` mode.
18
19
19
20
## Usage
20
21
21
22
```toml
22
23
[dependencies]
23
-
bare-io = "0.2"
24
+
core2 = "0.3"
24
25
```
25
26
26
-
Add the crate, use the things you would usually want from `std::io`, but instead from `bare_io`.
27
+
Add the crate, use the things you would usually want from `std::io`, but instead from `core2::io`, and
28
+
use `core2::error::Error` in place of `std::error::Error`.
27
29
28
30
### Features
29
31
30
32
-**std**: enables `std` pass-throughs for the polyfilled types, but allows accessing the new types
31
33
-**alloc**: enable aspects of the `Read` and `Write` traits that require `alloc` support (WIP)
32
34
-**nightly**: enables **nightly**-only features, such as `BufReader` and `BufWriter` with const generic buffers.
33
-
-**nightly-std**: enables `std` with **nightly**-only features
34
35
35
36
### Differences to `std::io`
36
37
@@ -49,11 +50,14 @@ Other than items perhaps being entirely missing or certain functions unavailable
49
50
50
51
All of the below are works in progress, but should help with demonstrating how to use this crate.
51
52
53
+
-[thiserror_core2](https://github.com/bbqsrc/thiserror-core2): fork of `thiserror` using the `core2::error::Error` trait.
54
+
<!--
52
55
- [fastvlq](https://github.com/bbqsrc/fastvlq): variable-length `u64` type with no-std reader support with `bare-io`
53
56
- [byteorder_bare-io](https://github.com/bbqsrc/byteorder): personal fork of `byteorder` crate
54
57
- [zstd-rs](https://github.com/bbqsrc/zstd-rs): personal fork of `zstd` crate to demonstrate `bare-io` in a more complex setting
55
58
- [comde](https://github.com/bbqsrc/comde): do compression/decompression similarly to how one might use `serde`
56
59
- [pathtrie](https://github.com/bbqsrc/pathtrie): a prefix trie optimised for paths and URLs, using an FST for fast lookups in no_std.
0 commit comments