Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
matrix:
rust-toolchain:
- nightly
- nightly-2025-05-20
- nightly-2025-12-12
- stable
env:
Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "axio"
version = "0.2.1"
edition = "2021"
edition = "2024"
authors = ["Yuekai Jia <[email protected]>"]
description = "`std::io`-like I/O traits for `no_std` environment"
description = "`std::io` for `no_std` environment"
license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0"
homepage = "https://github.com/arceos-org/arceos"
repository = "https://github.com/arceos-org/axio"
Expand All @@ -16,7 +16,8 @@ alloc = []
default = []

[dependencies]
axerrno = "0.1"
axerrno = "0.2"
memchr = { version = "2", default-features = false }

[build-dependencies]
autocfg = "1"
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@
[![Docs.rs](https://docs.rs/axio/badge.svg)](https://docs.rs/axio)
[![CI](https://github.com/arceos-org/axio/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/arceos-org/axio/actions/workflows/ci.yml)

[`std::io`][1]-like I/O traits for `no_std` environment.
[`std::io`][1] for `no_std` environment.

[1]: https://doc.rust-lang.org/std/io/index.html

### Features

- **alloc**:
- Enables extra methods on `Read`: `read_to_end`, `read_to_string`.
- Enables extra methods on `BufRead`: `read_until`, `read_line`, `split`, `lines`.
- Enables implementations of axio traits for `alloc` types like `Vec<u8>`, `Box<T>`, etc.

### Differences to `std::io`

- Error types from `axerrno` instead of `std::io::Error`.
- No `IoSlice` and `*_vectored` APIs.

### Limitations

- Requires nightly Rust.

## License

Licensed under either of

- GNU General Public License v3.0 or later, (<https://www.gnu.org/licenses/gpl-3.0.html>)
- Apache License, Version 2.0, (<https://www.apache.org/licenses/LICENSE-2.0>)
- Mulan Permissive Software License, Version 2, (<https://license.coscl.org.cn/MulanPSL2>)

at your option.

---

Almost all of the code in this repository is a copy of the [Rust language codebase](https://github.com/rust-lang/rust) with minor modifications.

For attributions, see <https://thanks.rust-lang.org/>.
18 changes: 18 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
unstable_features = true

style_edition = "2024"

group_imports = "StdExternalCrate"
imports_granularity = "Crate"

normalize_comments = true
wrap_comments = true
comment_width = 100

condense_wildcard_suffixes = true
enum_discrim_align_threshold = 20
use_field_init_shorthand = true

format_strings = true
format_code_in_doc_comments = true
format_macro_matchers = true
4 changes: 1 addition & 3 deletions src/buffered/bufreader.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::{BufRead, Read, Result};

#[cfg(feature = "alloc")]
use alloc::{string::String, vec::Vec};

const DEFAULT_BUF_SIZE: usize = 1024;
use crate::{BufRead, DEFAULT_BUF_SIZE, Read, Result};

/// The `BufReader<R>` struct adds buffering to any reader.
pub struct BufReader<R> {
Expand Down
2 changes: 0 additions & 2 deletions src/error.rs

This file was deleted.

54 changes: 0 additions & 54 deletions src/impls.rs

This file was deleted.

Loading