GitBook: [main] 54 pages modified

This commit is contained in:
boneyard93501 2021-06-10 18:21:19 +00:00 committed by gitbook-bot
parent 65e54c2220
commit e40e42e326
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF

View File

@ -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<Vec<u8>>,
}
// export foo as a public function bound by the
// IT type contraints
#[marine] #
pub fn foo(arg_1: Vec<Vec<Vec<Vec<TestRecord>>>>, arg_2: String) -> Vec<Vec<Vec<Vec<TestRecord>>>> {
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