Skip to main content

lenso_plugin_sdk_macros/
lib.rs

1//! Authoring markers for portable Rust Lenso Plugins.
2
3use proc_macro::TokenStream;
4
5/// Marks the ordinary Plugin type used by product SDK authoring macros.
6///
7/// Portable execution has no native lifecycle to register, so the marker keeps
8/// the type unchanged. Product SDKs generate the Capability dispatcher and the
9/// portable Runtime SDK generates execution-target glue.
10#[proc_macro_attribute]
11pub fn plugin(attributes: TokenStream, item: TokenStream) -> TokenStream {
12    if !attributes.is_empty() {
13        return syn::Error::new(
14            proc_macro2::Span::call_site(),
15            "portable #[lenso::plugin] does not accept lifecycle arguments",
16        )
17        .into_compile_error()
18        .into();
19    }
20    item
21}