[][src]Module grout::route

Various types and utilities for defining routes and route handlers.

Structs

ResponseBuilder

An HTTP response builder

Enums

PathSegment

Path segments are matched during routing. Static segments are matched through hash equality. If no static segments match, a corresponding dynamic segment is attempted. For example: GET /foo/bar matches vec![Static("foo"), Dynamic] instead of vec![Dynamic, Dynamic].

Type Definitions

Path

A route path is just a vec of PathSegments.

Request
Response
Route

Represents the route handler type. Although this is typed with a generic return type, this is only to allow async functions to be used as handlers. T is generally going to be impl Future< Output = Response>, meaning your route handlers are going to look exactly like this: