Skip to content

Commit

Permalink
[doc] update docs (#28)
Browse files Browse the repository at this point in the history
* ci(release-rust-sdk): update workflow

Signed-off-by: Xin Liu <[email protected]>

* doc(rust-sys): update rustdoc

Signed-off-by: Xin Liu <[email protected]>

* doc(rust-sdk): update rustdoc

Signed-off-by: Xin Liu <[email protected]>

* doc(rust-sys): update README and rustdoc

Signed-off-by: Xin Liu <[email protected]>

* doc(rust-sdk): update README and rustdoc

Signed-off-by: Xin Liu <[email protected]>

---------

Signed-off-by: Xin Liu <[email protected]>
  • Loading branch information
apepkuss authored Jul 21, 2023
1 parent ee2f127 commit c24fd4c
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-wasmedge-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Build API document
working-directory: wasmedge-rust-sdk
run: |
cargo doc -p wasmedge-sdk --workspace --no-deps --features aot,async,wasi_crypto,wasi_nn,wasmedge_process,ffi --target-dir=./target
cargo doc -p wasmedge-sdk --workspace --no-deps --features aot,wasi_crypto,wasi_nn,wasmedge_process,ffi --target-dir=./target
- name: Deploy API document
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Apache-2.0"
name = "wasmedge-sdk"
readme = "README.md"
repository = "https://github.com/WasmEdge/WasmEdge/blob/master/bindings/rust/wasmedge-sdk"
version = "0.10.0-dev"
version = "0.10.0"

[dependencies]
anyhow = "1.0"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Since this crate depends on the WasmEdge C API, it needs to be installed in your

| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
| 0.10.0 | 0.13.2 | 0.15.0 | 0.4.2 | 0.5.0 | 0.0.2 |
| 0.9.0 | 0.13.1 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
| 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
Expand Down
3 changes: 3 additions & 0 deletions crates/wasmedge-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ To use or build the `wasmedge-sys` crate, the `WasmEdge` library is required. Pl

| wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
| :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
| 0.10.0 | 0.13.2 | 0.15.0 | 0.4.2 | 0.5.0 | 0.0.2 |
| 0.9.0 | 0.13.1 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
| 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
| 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
Expand Down
14 changes: 8 additions & 6 deletions crates/wasmedge-sys/src/instance/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,13 @@ impl Function {
///
/// * `real_fn` - The pointer to the target function.
///
/// * `data` - The additional data object to set to this host function context.
/// * `data` - The host context data used in this function.
///
/// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
///
/// # Error
///
/// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
/// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](wasmedge_types::error::FuncError) is returned.
///
/// # Example
///
Expand Down Expand Up @@ -401,7 +401,7 @@ impl Function {
///
/// * `real_fn` - The pointer to the target function.
///
/// * `data` - The pointer to the data.
/// * `data` - The pointer to the host context data used in this function.
///
/// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
///
Expand Down Expand Up @@ -456,11 +456,13 @@ impl Function {
///
/// * `real_fn` - The pointer to the target function.
///
/// * `data` - The host context data used in this function.
///
/// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
///
/// # Error
///
/// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
/// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](wasmedge_types::error::FuncError) is returned.
///
#[cfg(all(feature = "async", target_os = "linux"))]
pub fn create_async_func<T: Send + Sync>(
Expand Down Expand Up @@ -519,13 +521,13 @@ impl Function {
///
/// * `real_fn` - The pointer to the target function.
///
/// * `data` - The pointer to the data.
/// * `data` - The pointer to the host context data used in this function.
///
/// * `cost` - The function cost in the [Statistics](crate::Statistics). Pass 0 if the calculation is not needed.
///
/// # Error
///
/// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
/// * If fail to create a [Function], then [WasmEdgeError::Func(FuncError::Create)](wasmedge_types::error::FuncError) is returned.
///
pub unsafe fn create_with_custom_wrapper(
ty: &FuncType,
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmedge-sys/src/instance/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Memory {
///
/// # Errors
///
/// * If fail to create the memory instance, then [WasmEdgeError::Mem(MemError::Create)](crate::error::MemError) is returned.
/// * If fail to create the memory instance, then [WasmEdgeError::Mem(MemError::Create)](wasmedge_types::error::MemError) is returned.
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmedge-sys/src/instance/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ impl ImportModule {
///
/// * `name` - The name of the import module instance.
///
/// * `host_data` - The host data to be stored in the module instance.
/// * `host_data` - The host context data used in this function.
///
/// # Error
///
Expand Down
2 changes: 2 additions & 0 deletions crates/wasmedge-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
//!
//! | wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
//! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
//! | 0.10.0 | 0.13.2 | 0.15.0 | 0.4.2 | 0.5.0 | 0.0.2 |
//! | 0.9.0 | 0.13.1 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
//! | 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
//! | 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
//! | 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmedge-sys/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl PluginManager {
///
/// # Error
///
/// * If the path contains invalid characters, then an [WasmEdgeError::FoundNulByte](crate::error::WasmEdgeError::FoundNulByte) error is returned.
/// * If the path contains invalid characters, then an [WasmEdgeError::FoundNulByte](wasmedge_types::error::WasmEdgeError::FoundNulByte) error is returned.
pub fn load_plugins(path: impl AsRef<std::path::Path>) -> WasmEdgeResult<()> {
let c_path = utils::path_to_cstring(path.as_ref())?;
unsafe { ffi::WasmEdge_PluginLoadFromPath(c_path.as_ptr()) }
Expand Down
6 changes: 5 additions & 1 deletion src/externals/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Func {
///
/// * `real_func` - The native function that will be wrapped as a host function.
///
/// * `data` - The additional data object to set to this host function context.
/// * `data` - The host context data used in this function.
///
/// # Error
///
Expand Down Expand Up @@ -64,6 +64,8 @@ impl Func {
///
/// * `real_func` - The native function to be wrapped.
///
/// * `data` - The host context data used in this function.
///
/// # Error
///
/// * If fail to create a Func instance, then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
Expand Down Expand Up @@ -103,6 +105,8 @@ impl Func {
///
/// * `real_func` - The native function to be wrapped.
///
/// * `data` - The host context data used in this function.
///
/// # Error
///
/// * If fail to create a Func instance, then [WasmEdgeError::Func(FuncError::Create)](crate::error::FuncError) is returned.
Expand Down
6 changes: 4 additions & 2 deletions src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl ImportObjectBuilder {
///
/// * `real_func` - The native function.
///
/// * `data` - The additional data object to set to this host function context.
/// * `data` - The host context data used in this function.
///
/// # error
///
Expand Down Expand Up @@ -81,7 +81,7 @@ impl ImportObjectBuilder {
///
/// * `real_func` - The native function.
///
/// * `data` - The additional data object to set to this host function context.
/// * `data` - The host context data used in this function.
///
/// # error
///
Expand Down Expand Up @@ -116,6 +116,8 @@ impl ImportObjectBuilder {
///
/// * `real_func` - The native function.
///
/// * `data` - The host context data used in this function.
///
/// # error
///
/// If fail to create or add the [host function](crate::Func), then an error is returned.
Expand Down
5 changes: 0 additions & 5 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,10 @@ impl WasmVal for ExternRef {

/// Used to pass arguments to the following methods:
/// - [Func::run](crate::Func::run)
/// - [Func::run_async](crate::Func::run_async)
/// - [FuncRef::run](crate::FuncRef::run)
/// - [FuncRef::run_async](crate::FuncRef::run_async)
/// - [Executor::run_func](crate::Executor::run_func)
/// - [Executor::run_func_async](crate::Executor::run_func_async)
/// - [Executor::run_func_ref](crate::Executor::run_func_ref)
/// - [Executor::run_func_ref_async](crate::Executor::run_func_ref_async)
/// - [Vm::run_func](crate::Vm::run_func)
/// - [Vm::run_func_async](crate::Vm::run_func_async)
///
/// Notice that to use the macro, it is required to use `WasmVal` trait. If the version of rust used is less than v1.63, please place `#![feature(explicit_generic_args_with_impl_trait)]` on the root of the program.
#[macro_export]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
//!
//! | wasmedge-sdk | WasmEdge lib | wasmedge-sys | wasmedge-types| wasmedge-macro| async-wasi|
//! | :-----------: | :-----------: | :-----------: | :-----------: | :-----------: | :-------: |
//! | 0.10.0 | 0.13.2 | 0.15.0 | 0.4.2 | 0.5.0 | 0.0.2 |
//! | 0.9.0 | 0.13.1 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
//! | 0.9.0 | 0.13.0 | 0.14.0 | 0.4.2 | 0.4.0 | 0.0.1 |
//! | 0.8.1 | 0.12.1 | 0.13.1 | 0.4.1 | 0.3.0 | - |
//! | 0.8.0 | 0.12.0 | 0.13.0 | 0.4.1 | 0.3.0 | - |
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl<T: Send + Sync + Clone> PluginModuleBuilder<T> {
}
}

/// Adds a [host function](crate::Func) to the [ImportObject] to create.
/// Adds a [host function](crate::Func) to the [crate::ImportObject] to create.
///
/// N.B. that this function can be used in thread-safe scenarios.
///
Expand Down

0 comments on commit c24fd4c

Please sign in to comment.