Macro finchers::path[][src]

macro_rules! path {
    (@$method:ident $($t:tt)*) => { ... };
    (/ $($t:tt)*) => { ... };
}

A helper macro for creating an endpoint which matches to the specified HTTP path.

Example

The following macro call

This example is not tested
path!(@get / "api" / "v1" / "posts" / i32);

will be roughly expanded to:

This example is not tested
syntax::verb::get()
    .and("api")
    .and("v1")
    .and("posts")
    .and(syntax::param::<i32>())
)