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

path!(@get / "api" / "v1" / "posts" / i32)

will be expanded to the following code:

use finchers::endpoint::syntax;
syntax::verb::get()
    .and("api")
    .and("v1")
    .and("posts")
    .and(syntax::param::<i32>())