Attribute Macro poem_derive::handler[][src]

#[handler]
Expand description

Wrap an asynchronous function as an Endpoint.

Attributes

host="host name" - Add a host guard. header("header name", "header value) - Add a header value guard.

Example

#[handler(
    host = "example.com",
    header(name = "Custom-header", value = "true")
)]
async fn example() {
}