From e40e42e326581a03856bf93b6709d40a92c66733 Mon Sep 17 00:00:00 2001 From: boneyard93501 Date: Thu, 10 Jun 2021 18:21:19 +0000 Subject: [PATCH] GitBook: [main] 54 pages modified --- .../marine/marine-rs-sdk.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md b/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md index 30abe89..ec47c76 100644 --- a/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md +++ b/knowledge_knowledge/knowledge_aquamarine/marine/marine-rs-sdk.md @@ -24,3 +24,36 @@ In other words, the arguments must be one of the types listed below: The return type of a function must follow the same rules, but currently only one return type is possible. +Below an example of an exposed function with a complex type signature and return value: + +```rust +// export TestRecord as a public data structure bound by +// the IT type constraints +#[marine] +pub struct TestRecord { + pub field_0: i32, + pub field_1: Vec>, +} + +// export foo as a public function bound by the +// IT type contraints +#[marine] # +pub fn foo(arg_1: Vec>>>, arg_2: String) -> Vec>>> { + unimplemented!() +} +``` + + + +{% hint style="info" %} +Function Export Requirements + +* wrap a target function with the `[marine]` macro +* function arguments must by of `ftype` +* the function return type also must be of `ftype` +{% endhint %} + +#### Function Import + + +