Struct rocket::Route [] [src]

pub struct Route {
    pub method: Method,
    pub handler: Handler,
    pub path: URI<'static>,
    pub rank: isize,
    pub format: Option<ContentType>,
}

A route: a method, its handler, path, rank, and format/content type.

Fields

The method this route matches against.

A function that should be called when the route matches.

The path (in Rocket format) that should be matched against.

The rank of this route. Lower ranks have higher priorities.

The Content-Type this route matches against.

Methods

impl Route
[src]

Creates a new route with the method, path, and handler.

The rank of the route will be 0 if the path contains no dynamic segments, and 1 if it does.

Creates a new route with the given rank, method, path, and handler.

Sets the path of the route. Does not update the rank or any other parameters.

Trait Implementations

impl Clone for Route
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Display for Route
[src]

Formats the value using the given formatter.

impl Debug for Route
[src]

Formats the value using the given formatter.