Struct percy_router::prelude::Route

source ·
pub struct Route { /* private fields */ }
Expand description

A route specifies a path to match against. When a match is found a view_creator is used to return an impl View that can be used to render the appropriate content for that route.

Implementations§

Create a new Route. You’ll usually later call route.match(…) in order to see if a given the path in the browser URL matches your route’s path definition.

Determine whether or not our route matches a provided path.

Example
// path = "/food/:food_type"

route.matches("/food/tacos");

Given an incoming path and a param_key, get the RouteParam

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.