-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Hiver requires Rust 1.93 or later. Hiver 需要 Rust 1.93 或更高版本。
# Install Rust / 安装 Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Verify installation / 验证安装
rustc --version
cargo --version| Platform / 平台 | Driver / 驱动 | Status / 状态 |
|---|---|---|
| Linux (5.1+) | io-uring | ✅ Fully Supported / 完全支持 |
| Linux (older) | epoll | ✅ Fully Supported / 完全支持 |
| macOS | kqueue | ✅ Fully Supported / 完全支持 |
| FreeBSD | kqueue | ✅ Fully Supported / 完全支持 |
| Windows | IOCP |
For best performance on Linux, ensure you have kernel 5.1+ with io-uring support: 为在 Linux 上获得最佳性能,请确保内核 5.1+ 并支持 io-uring:
# Check kernel version / 检查内核版本
uname -r
# For Ubuntu/Debian, install liburing-dev (optional)
# 对于 Ubuntu/Debian,安装 liburing-dev(可选)
sudo apt-get install liburing-devHiver is modular — add only what you need: Hiver 是模块化的 — 只添加你需要的:
[dependencies]
hiver-runtime = "0.1.0-alpha"
hiver-http = "0.1.0-alpha"
hiver-router = "0.1.0-alpha"
hiver-middleware = "0.1.0-alpha"Or use cargo-add: 或使用 cargo-add:
cargo add hiver-runtime hiver-http hiver-routerTo use the latest development version: 使用最新的开发版本:
[dependencies]
hiver-runtime = { git = "https://github.com/ViewWay/hiver", package = "hiver-runtime" }Create a simple test project: 创建一个简单的测试项目:
cargo new hello-hiver
cd hello-hiverEdit Cargo.toml:
编辑 Cargo.toml:
[dependencies]
hiver-runtime = "0.1.0-alpha"Edit src/main.rs:
编辑 src/main.rs:
use hiver_runtime::Runtime;
fn main() -> std::io::Result<()> {
let runtime = Runtime::new()?;
runtime.block_on(async {
println!("Hiver is working!");
println!("Hiver 运行正常!");
});
Ok(())
}cargo runIf you see the output, installation is successful! 如果你看到输出,说明安装成功!
# Clone the repository / 克隆仓库
git clone https://github.com/ViewWay/hiver.git
cd hiver
# Build all crates / 构建所有 crate
cargo build --workspace
# Build with optimizations / 优化构建
cargo build --workspace --release
# Run tests / 运行测试
cargo test --workspaceHiver works with any Rust IDE. Recommended extensions: Hiver 可与任何 Rust IDE 配合使用。推荐扩展:
- rust-analyzer: Language server for Rust
- Even Better TOML: TOML file support
- crates: Cargo.tomL dependency management
On Linux systems without io-uring support (kernel < 5.1), Hiver will automatically fall back to epoll. This is transparent and requires no configuration changes.
在没有 io-uring 支持的 Linux 系统上(内核 < 5.1),Hiver 会自动回退到 epoll。这是透明的,不需要配置更改。
-
Check Rust version: Ensure you're using Rust 1.93+ 检查 Rust 版本:确保你使用的是 Rust 1.93+
-
Update dependencies: Run
cargo update更新依赖:运行cargo update -
Clean build: Run
cargo clean && cargo build清理构建:运行cargo clean && cargo build
Windows support is still in development. Use WSL2 for now. Windows 支持仍在开发中。目前请使用 WSL2。
← Previous / 上一页 | Next / 下一页 →
Hiver Framework
Getting Started / 快速开始
Core Concepts / 核心概念
Data Layer / 数据层
Security / 安全
Advanced / 高级主题
Cloud & Messaging
AI
Reference / 参考