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
66 changes: 34 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,28 @@ jobs:
strategy:
fail-fast: false
matrix:
rust-toolchain: [nightly]
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, clippy, rustfmt
targets: ${{ matrix.targets }}
- name: Check rust version
run: rustc --version --verbose
- name: Check code format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --target ${{ matrix.targets }} --all-features -- -A clippy::new_without_default
- name: Build
run: cargo build --target ${{ matrix.targets }} --all-features
- name: Unit test
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }}
run: cargo test --target ${{ matrix.targets }} -- --nocapture
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rust-src, rustfmt, clippy
targets: ${{ matrix.targets }}
override: true
- name: Check rust version
run: rustc --version --verbose
- name: Check code format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -Z build-std=core,alloc --target ${{ matrix.targets }} --all-features -- -A clippy::new_without_default
- name: Build
run: cargo build -Z build-std=core,alloc --target ${{ matrix.targets }} --all-features
- name: Unit test
if: ${{ matrix.targets == 'x86_64-unknown-linux-gnu' }}
run: cargo test --target ${{ matrix.targets }} -- --nocapture

doc:
runs-on: ubuntu-latest
Expand All @@ -39,17 +41,17 @@ jobs:
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links -D missing-docs
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Build docs
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
run: |
cargo doc --no-deps --all-features
printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html
- name: Deploy to Github Pages
if: ${{ github.ref == env.default-branch }}
uses: JamesIves/github-pages-deploy-action@v4
with:
single-commit: true
branch: gh-pages
folder: target/doc
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Build docs
continue-on-error: ${{ github.ref != env.default-branch && github.event_name != 'pull_request' }}
run: |
cargo doc --no-deps --all-features
printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html
- name: Deploy to Github Pages
if: ${{ github.ref == env.default-branch }}
uses: JamesIves/github-pages-deploy-action@v4
with:
single-commit: true
branch: gh-pages
folder: target/doc
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/target
/.vscode
.vscode
.DS_Store
Cargo.lock
.idea
*.json
*.xml
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[package]
name = "axio"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["Yuekai Jia <[email protected]>"]
authors = [
"Yuekai Jia <[email protected]>",
"Leo Cheng <[email protected]>",
]
description = "`std::io`-like I/O traits 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"
Expand All @@ -16,4 +19,4 @@ alloc = []
default = []

[dependencies]
axerrno = "0.1"
axerrno = { version = "0.1" }
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
# axio
<h1 align="center" style="margin-bottom: 0;">axio</h1>

<div align="left" style="margin-bottom: 1.5em">

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

</div>



---

<div align="center" style="
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.2em;
margin: 0.2em 0;
">

[![Crates.io](https://img.shields.io/crates/v/axio)](https://crates.io/crates/axio)
[![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)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-docs-8A2BE2)](https://deepwiki.org/arceos-org/axio)
[![Dependencies](https://img.shields.io/librariesio/release/cargo/axio)](https://libraries.io/cargo/axio)
[![Downloads](https://img.shields.io/crates/d/axio)](https://crates.io/crates/axio)
[![Code Size](https://img.shields.io/github/languages/code-size/arceos-org/axio)](https://github.com/arceos-org/axio)

[`std::io`][1]-like I/O traits for `no_std` environment.
[![Activity](https://img.shields.io/github/commit-activity/m/arceos-org/axio)](https://github.com/arceos-org/axio/pulse)
[![Toolchain](https://img.shields.io/badge/toolchain-nightly--2025--06--18-orange)](https://rust-lang.github.io/rustup/concepts/channels.html)
[![License](https://img.shields.io/crates/l/axio)](https://github.com/arceos-org/axio/blob/main/LICENSE)

</div>

---

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



## Example

```rust
fn main() {
use axio::{Read, BufReader};

let data = b"hello world";
let mut reader = BufReader::new(&data[..]);
let mut buf = [0u8; 5];
reader.read_exact(&mut buf).unwrap();
}
```
2 changes: 2 additions & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2025-05-12"
Loading