Skip to content
项目

关于

Rust 的 WASI 绑定。

开发工具

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

wasi

A Bytecode Alliance project

WASI API Bindings for Rust

Crates.io version Download docs.rs docs

This repository contains low-level Rust bindings to WASI APIs which are distributed and published to crates on crates.io. Crates currently are:

  • wasi - this is a reexport of the latest stable WASI proposal. At this time this represents bindings to WASIp2.
  • wasip1 - this crate explicitly contains bindings for the WASIp1 snapshot. Development of the WASIp1 version of the standard has ceased and this crate is in maintenance mode.
  • wasip2 - this crate explicitly contains bindings for the latest stable WASIp2 release generated by the latest stable wit-bindgen release.
  • wasip3 - contains the latest snapshot of the WASIp3 APIs using the latest wit-bindgen.

The wasi crate

The wasi crate today is a lightweight reexport of the latest stable version of the WASI standard. Currently that is WASIp2. The wasi crate version number will be bumped every timet he wasip2 crate version number is bumped, for example, and its interface and bindings may change over time as WASIp2 APIs are added or the wit-bindgen tool to generate bindings evolves.

To explicitly indicate which version of the WASI standard you'd like to use it's recommended to use the wasip2 crate directly.

Crate version numbers

The wasi crate contains "build metadata" which indicates what version of the WASI standard it contains bindings for. This metadata is purely informational and cannot be used to constrain a version requirement in Cargo. This scheme is mirrored for the wasip2 crate as well, for example.

Which crate to use?

The most appropriate crate to use depends on the WebAssembly Rust target that you're compiling with:

  • wasm32-unknown-unknown - don't use any of these crates in this repository as WASI is typically not intended to be used with this target.
  • wasm32-wasip1 - use the wasip1 crate, as other crates are based on component APIs which this target does not use.
  • wasm32-wasip2 - use the wasip2 crate and update as-needed to newer versions.
  • wasm32-wasip3 - use the wasip3 crate.

For component-producing targets, for example wasm32-wasip2 and wasm32-wasip3, you can technically use any of wasip2, wasip3, or wasi. It's recommended where possible to stick with the target, however.

License

This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

探索相关项目

加载中…