| Crates.io | proc-macro-api |
| lib.rs | proc-macro-api |
| version | 0.1.5 |
| created_at | 2025-04-22 09:58:18.48724+00 |
| updated_at | 2025-05-09 04:36:06.200079+00 |
| description | A macro helping with exporting APIs in a proc-macro library crate. |
| homepage | |
| repository | https://github.com/BoxCatGarden/proc_macro_api |
| max_upload_size | |
| id | 1643774 |
| size | 33,298 |
A crate helping with structuring the library crate of a proc-macro package.
The major of this crate is macro proc_macro_api!,
which can export functions in submodules of a proc-macro crate as
the Application Programing Interfaces (APIs) of that proc-macro crate.
For example, assuming sub is a submodule of the root of
a proc-macro crate and has a function,
pub fn proc_fn(input: TokenStream) -> TokenStream, in order to export
proc_fn as a function-like macro, proc_macro_api! can be used in the
root of the crate like:
proc_macro_api! {
sub::{
#[proc_macro]
proc_fn,
},
}
Then, a function-like macro, proc_fn!(), is available from that
proc-macro crate.
Note: See the crate documentation for more details.