[][src]Attribute Macro abi_stable_derive::export_sabi_module

#[export_sabi_module]

This attribute is used for functions which export a module in an implementation crate.

When applied it creates a mangled function which calls the annotated function, as well as check its type signature.

This is applied to functions like this:

This example is not tested

#[export_sabi_module]
pub extern "C" fn get_hello_world_mod() -> WithLayout<TextOperationsMod> {
    extern_fn_panic_handling!{
        let module=TextOperationsMod{
            reverse_string,
        };
        WithLayout::new(module)
    }
}

More examples

For a more detailed example look into the example/example_*_impl crates in the repository for this crate.