mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
doc(api) Improve documentation of HostFunctionKind and impls.
This commit is contained in:
19
lib/api/src/externals/function.rs
vendored
19
lib/api/src/externals/function.rs
vendored
@@ -630,28 +630,27 @@ mod inner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Empty trait to specify the kind of `HostFunction`: With or
|
/// Empty trait to specify the kind of `HostFunction`: With or
|
||||||
/// without a `vm::Ctx` argument. See the `ExplicitVmCtx` and the
|
/// without an environment.
|
||||||
/// `ImplicitVmCtx` structures.
|
|
||||||
///
|
///
|
||||||
/// This trait is never aimed to be used by a user. It is used by the
|
/// This trait is never aimed to be used by a user. It is used by
|
||||||
/// trait system to automatically generate an appropriate `wrap`
|
/// the trait system to automatically generate the appropriate
|
||||||
/// function.
|
/// host functions.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub trait HostFunctionKind {}
|
pub trait HostFunctionKind {}
|
||||||
|
|
||||||
/// An empty struct to help Rust typing to determine
|
/// An empty struct to help Rust typing to determine
|
||||||
/// when a `HostFunction` doesn't take an Environment
|
/// when a `HostFunction` does have an environment.
|
||||||
pub struct WithEnv {}
|
pub struct WithEnv;
|
||||||
|
|
||||||
impl HostFunctionKind for WithEnv {}
|
impl HostFunctionKind for WithEnv {}
|
||||||
|
|
||||||
/// An empty struct to help Rust typing to determine
|
/// An empty struct to help Rust typing to determine
|
||||||
/// when a `HostFunction` takes an Environment
|
/// when a `HostFunction` does not have an environment.
|
||||||
pub struct WithoutEnv {}
|
pub struct WithoutEnv;
|
||||||
|
|
||||||
impl HostFunctionKind for WithoutEnv {}
|
impl HostFunctionKind for WithoutEnv {}
|
||||||
|
|
||||||
/// Represents a function that can be used by WebAssembly.
|
/// Represents a low-level Wasm host function.
|
||||||
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
|
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
|
||||||
pub struct Function<Args = (), Rets = ()> {
|
pub struct Function<Args = (), Rets = ()> {
|
||||||
address: *const VMFunctionBody,
|
address: *const VMFunctionBody,
|
||||||
|
|||||||
Reference in New Issue
Block a user