#[serverless]Expand description
Attribute macro for marking a function as a serverless function.
This macro generates:
- The original function implementation
- A client stub for remote calls (when
remote_callfeature is enabled) - A wrapper function for local calls (when
local_callfeature is enabled) - Server registration code for automatic function discovery
§Example
ⓘ
use serverless_fn::{serverless, ServerlessError};
#[serverless]
pub async fn hello(name: String) -> Result<String, ServerlessError> {
Ok(format!("Hello, {}!", name))
}