pub struct Route { /* fields omitted */ }
Expand description

Route

This struct defines a Route. A route is an address defined on a webserver by a /. For example, localhost/search - /search is the route.

This struct will store a reference to a function or closure, and will run it automatically when a user visits the corresponding route defined to the function.

Implementations

New

Create a new route, taking in a Boxed function as its input.

Run

Run the function, taking in the request as its input. It will return a corresponding DataType based on the output of the function.

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

Performs the conversion.

Performs the conversion.

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.