service_method

Attribute Macro service_method 

Source
#[service_method]
Expand description

Marks a method as a service endpoint with optional HTTP route information.

The route string is used by the API gateway to generate REST endpoints. If no route is provided, only RPC calls will be supported.

§Examples

#[service_method("GET /users/:id")]
pub async fn get_user(user_id: u32) -> Result<User, String> { ... }

#[service_method("POST /users")]
pub async fn create_user(data: CreateUserRequest) -> Result<User, String> { ... }

#[service_method] // RPC only
pub async fn internal_cleanup() -> Result<(), String> { ... }