pub struct UseRoute { /* private fields */ }
Expand description

A handle to the current location of the router.

Implementations

Get the underlying Url of the current location.

Get the first query parameter given the parameter name.

If you need to get more than one parameter, use [query_pairs] on the Url instead.

Get the first query parameter given the parameter name.

If you need to get more than one parameter, use [query_pairs] on the Url instead.

Returns the nth segment in the path. Paths that end with a slash have the slash removed before determining the segments. If the path has fewer segments than n then this method returns None.

Returns the last segment in the path. Paths that end with a slash have the slash removed before determining the segments. The root path, /, will return an empty string.

Get the named parameter from the path, as defined in your router. The value will be parsed into the type specified by T by calling value.parse::<T>(). This method returns None if the named parameter does not exist in the current path.

Get the named parameter from the path, as defined in your router. The value will be parsed into the type specified by T by calling value.parse::<T>(). This method returns None if the named parameter does not exist in the current path.

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.