Skip to main content

server_function

Attribute Macro server_function 

Source
#[server_function]
Expand description

Defines a bounded, dual-target Rullst server function.

The annotated item must be a concrete async free function with at most 16 identifier parameters and a rullst::rpc::RpcResult<T> return type. Native builds retain its body and generate <name>_rpc_router(). Wasm builds serialize the arguments into the versioned rullst.client envelope and call the exact generated endpoint.

path = "/api/rpc/..." is optional; otherwise the final path segment is the function name. Mount the generated router before applying Rullst’s production security and application identity/authorization layers.