From 68a652ed2f51d366bb8033497e6dfe545895410e Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 23 Jul 2026 08:08:33 +0800 Subject: feat: scaffold crate structure and implement core macros Add the project skeleton, LICENSE files, README, Makefile, doc examples, and the initial implementation of `#[func]`, `invoke!`, and `select!` procedural macros. --- doc/func.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/func.md (limited to 'doc/func.md') diff --git a/doc/func.md b/doc/func.md new file mode 100644 index 0000000..86925d7 --- /dev/null +++ b/doc/func.md @@ -0,0 +1,12 @@ +Attribute macro that generates both a sync and an async version of a function, +gated by a Cargo feature flag. + +The function is written as a regular (non-async) `fn`. The macro duplicates it +internally into two implementations: + +- When the feature is **disabled**: the original `fn` is used as-is. +- When the feature is **enabled**: the function is promoted to `async fn`. + +By default the feature name is `"async"`. A different name can be supplied as +an attribute argument, for example `#[func("tokio_rt")]` to gate on the feature +`"tokio_rt"` instead. -- cgit