cljrs-export-macro 0.1.101
Rust proc macro entrypointRust procedural-macro entrypoint declaration
SHA-25683dfe2c233e912ca588c705f6d4b125352558a5f5a0cc093cbbbd2878acb972d
MaleculeO(S)H(Db)Md
Evidence
1:35… jrs_interop::export]`.
2//!
3//! Do not depend on this crate directly. Use `cljrs_interop` instead:
4//!
5//! ```rust,ignore
6//! use cljrs_interop::expo …
8:7… export(ns = "math")]
9//! pub fn add(a: i64, b: i64) -> Result<i64, String> {
10//! Ok(a + b)
11//! }
12//! ```
13
14use proc_macro::TokenStream;
15use proc_macro2::TokenStream as TokenStream2;
16use quote::{format_ident, quote};
17use syn::{
18 FnArg, ItemFn, LitInt, LitStr, PatType, ReturnType, Token, Type,
19 parse::{Parse, ParseStream},
20 parse_macro_input,
21};
22
23// ── Attribute argument parsing ────────────────────────────────────────────────
24
25struct ExportArgs {
26 ns: Option<LitStr>,
27 name: Option<LitStr>,
28 /// Minimum arity for variadic functions (default 0).
29 variadic_min: Option<LitInt>,
30}
31
32impl Parse for ExportArgs …
36:15… t variadic_min: Option<LitInt> = None;
37
38 while !input.is_empty() {
39 let key: syn::Ident = input.parse()?;
40 input.parse::< …
70:174… ��────────
71
72/// Expose a Rust function as a Clojurust native function.
73///
74/// The macro keeps the original function intact and generates an
75/// [`inventory`] submission that registers the function when
76/// [`cljrs_interop::register_exports`] is called.
77///
78/// # Requir …
84:55… symbol name
85/// (default: Rust function name with `_` replaced by `-`).
86/// - `variadic_min = N` — for variadic functions, set the minimum arit …
No evidence locations were recorded for this file. Raw result