mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 13:11:32 +00:00
Refine the runtime api and document the exposed items (#115)
* private module, remove unused method, docs on compile_with * refine runtime api and document exposed items * Fix integration test build * Fix lint
This commit is contained in:
@ -51,6 +51,29 @@ macro_rules! __export_func_convert_type {
|
||||
};
|
||||
}
|
||||
|
||||
/// Generate an [`ImportObject`] safely.
|
||||
///
|
||||
/// [`ImportObject`]: struct.ImportObject.html
|
||||
///
|
||||
/// # Note:
|
||||
/// The `import` macro currently only supports
|
||||
/// importing functions.
|
||||
///
|
||||
///
|
||||
/// # Usage:
|
||||
/// ```
|
||||
/// # use wasmer_runtime_core::imports;
|
||||
/// # use wasmer_runtime_core::vm::Ctx;
|
||||
/// let import_object = imports! {
|
||||
/// "env" => {
|
||||
/// "foo" => foo<[i32] -> [i32]>,
|
||||
/// },
|
||||
/// };
|
||||
///
|
||||
/// extern fn foo(n: i32, _: &mut Ctx) -> i32 {
|
||||
/// n
|
||||
/// }
|
||||
/// ```
|
||||
#[macro_export]
|
||||
macro_rules! imports {
|
||||
( $( $ns_name:expr => $ns:tt, )* ) => {{
|
||||
|
Reference in New Issue
Block a user