From 832dfd4c712934592e65febb39e557824f2b0b14 Mon Sep 17 00:00:00 2001 From: boneyard93501 Date: Fri, 11 Jun 2021 17:24:38 +0000 Subject: [PATCH] GitBook: [main] 53 pages modified --- .../marine/marine-rs-sdk.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md b/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md index f9593ed..cf0d7ce 100644 --- a/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md +++ b/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md @@ -60,10 +60,10 @@ The `[marine]` macro can also wrap an [`extern` block](https://doc.rust-lang.org * There should be another module, module B, that exports the same functions. The name of module B is indicated in the `link` macro \(see examples below\). * Module B should be loaded to `Marine` by the moment the loading of module A starts. Module A cannot be loaded if at least one imported function is absent in `Marine`. +See the examples below for wrapped `extern` block usage: - -See the example below of a wrapped `extern` block: - +{% tabs %} +{% tab title="Example 1" %} ```rust #[marine] pub struct TestRecord { @@ -79,6 +79,18 @@ extern "C" { pub fn foo(arg: Vec>>>, arg_2: String) -> Vec>>>; } ``` +{% endtab %} + +{% tab title="Example 2" %} +```rust +[marine] +#[link(wasm_import_module = "some_module")] +extern "C" { + pub fn foo(arg: Vec>>>) -> Vec>>>; +} +``` +{% endtab %} +{% endtabs %}