Skip to main content

routes_with_options

Function routes_with_options 

Source
pub fn routes_with_options<S: TranscodeState>(
    pool: &DescriptorPool,
    aliases: &[AliasConfig],
    options: &TranscodeOptions,
) -> Router<S>
Expand description

routes, built as options describe.

A binding answers the requests whose path matches its template, custom verb included (/v1/{name}:cancel, google/api/http.proto Verb), and whose method is its own; a GET binding answers HEAD too. A request’s verb is its last segment from the first unencoded :: a verb some binding of its path binds owns the URL, answered by that verb’s bindings alone; a verb none binds stays part of the last variable. A URL that bindings answer, but none with the request’s method, is 405 with their methods in Allow; a path that matches a template but that no binding answers is 404.

A second binding for a method, path and verb already taken (or any binding on a path and verb a custom * rule takes, which answers every method), and a template the router cannot match (text around a variable within one segment, a path that does not start with /), are skipped with an error in the log.