1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
/*! An implementation detail of abi_stable. */ extern crate proc_macro; extern crate abi_stable_derive_lib; use proc_macro::TokenStream as TokenStream1; /** This macro is documented in abi_stable::docs */ #[proc_macro_derive(StableAbi, attributes(sabi))] pub fn derive_stable_abi(input: TokenStream1) -> TokenStream1 { abi_stable_derive_lib::derive_stable_abi(input) } /** Allows implementing the InterfaceType trait, providing default values for associated types not specified in the impl block. For an example look at `abi_stable::erased_types::InterfaceType`. */ #[proc_macro] #[allow(non_snake_case)] pub fn impl_InterfaceType(input: TokenStream1) -> TokenStream1 { abi_stable_derive_lib::impl_InterfaceType(input) } /** 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: ```ignore use abi_stable::prefix_type::PrefixTypeTrait; #[export_root_module] pub extern "C" fn get_hello_world_mod() -> &'static TextOperationsMod { extern_fn_panic_handling!{ TextOperationsModVal{ reverse_string, }.leak_into_prefix() } } # fn main(){} ``` # More examples For a more detailed example look in the README in the repository for this crate. */ #[proc_macro_attribute] pub fn export_root_module(attr: TokenStream1, item: TokenStream1) -> TokenStream1 { abi_stable_derive_lib::mangle_library_getter_attr(attr,item) }