Skip to main content

patch

Attribute Macro patch 

Source
#[patch]
Expand description

Annotate an async function as a PATCH route handler.

Generates a companion function that returns a crate::route::Route and a typed __autumn_path_{name}(…) -> String path helper.

§Examples

use autumn_web::patch;

#[patch("/items/{id}")]
async fn patch_item() -> &'static str {
    "patched"
}

Annotate an async function as a PATCH route handler.

Generates a companion __autumn_route_info_{name}() function and a typed __autumn_path_{name}(…) -> String path helper.

§Example

use autumn_web::patch;

#[patch("/items/{id}")]
async fn patch_item() -> &'static str {
    "patched"
}