|
1 | | -/// ewasm_api is a library used to interface with Ethereum's EEI in Ewasm, a set of enhancements to |
2 | | -/// the Ethereum smart contract platform. |
3 | | -/// ewasm_api exposes both a set of unsafe "native" functions representing the actual EEI |
4 | | -/// functions, and a set of safe wrappers around them. It is recommended not to use the native |
5 | | -/// functions as they do not perform bounds-checking. |
6 | | -/// |
7 | | -/// To use ewasm_api, simply include it as a dependency in your project. |
8 | | -/// |
9 | | -/// # Examples |
10 | | -/// ```ignore |
11 | | -/// extern crate ewasm_api; |
12 | | -/// |
13 | | -/// use ewasm_api::{Hash, block_hash, finish_data}; |
14 | | -/// |
15 | | -/// #[cfg(target_arch = "wasm32")] |
16 | | -/// #[no_mangle] |
17 | | -/// pub extern "C" fn main() { |
18 | | -/// let a: Hash = block_hash(1); |
19 | | -/// finish_data(&a.bytes); |
20 | | -/// } |
21 | | -/// ``` |
| 1 | +//! ewasm_api is a library used to interface with Ethereum's EEI in [Ewasm](https://github.com/ewasm/design), a set of enhancements to |
| 2 | +//! the Ethereum smart contract platform. |
| 3 | +//! ewasm_api exposes both a set of unsafe "native" functions representing the actual EEI |
| 4 | +//! functions, and a set of safe wrappers around them. It is recommended not to use the native |
| 5 | +//! functions as they do not perform bounds-checking. |
| 6 | +//! |
| 7 | +//! To use ewasm_api, simply include it as a dependency in your project. |
| 8 | +//! ewasm_api can be built with various feature sets: |
| 9 | +//! - `default`: Builds with `wee_alloc` as the global allocator and with the Rust standard |
| 10 | +//! library. |
| 11 | +//! - `qimalloc`: Builds with [qimalloc](https://github.com/wasmx/qimalloc) as the global |
| 12 | +//! allocator. |
| 13 | +//! - `debug`: Exposes the debugging interface. |
| 14 | +//! - `experimental`: Exposes the experimental bignum system library API. |
| 15 | +//! |
| 16 | +//! # Examples |
| 17 | +//! ```ignore |
| 18 | +//! extern crate ewasm_api; |
| 19 | +//! |
| 20 | +//! use ewasm_api::{Hash, block_hash, finish_data}; |
| 21 | +//! |
| 22 | +//! #[cfg(target_arch = "wasm32")] |
| 23 | +//! #[no_mangle] |
| 24 | +//! pub extern "C" fn main() { |
| 25 | +//! let a: Hash = block_hash(1); |
| 26 | +//! finish_data(&a.bytes); |
| 27 | +//! } |
| 28 | +//! ``` |
22 | 29 |
|
23 | 30 | #[macro_use] |
24 | 31 | extern crate cfg_if; |
|
0 commit comments