diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-23 08:08:33 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-23 14:01:45 +0800 |
| commit | 68a652ed2f51d366bb8033497e6dfe545895410e (patch) | |
| tree | d463833846248410733e196a0939c59cd67ca8a2 /doc/func.md | |
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.
Diffstat (limited to 'doc/func.md')
| -rw-r--r-- | doc/func.md | 12 |
1 files changed, 12 insertions, 0 deletions
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. |
