Struct highnoon::Route

source ·
pub struct Route<'a, 'p, S: State> { /* private fields */ }
Expand description

Returned by App::at and attaches method handlers to a route.

Implementations

Attach an endpoint for a specific HTTP method

Attach an endpoint for all HTTP methods. These will be checked only if no specific endpoint exists for the method.

Attach an endpoint for GET requests

Attach an endpoint for POST requests

Attach an endpoint for PUT requests

Attach an endpoint for DELETE requests

Serve static files located in the path root. The path should end with a wildcard segment (ie. /*). The wildcard portion of the URL will be appended to root to form the full path. The file extension is used to guess a mime type. Files outside of root will return a FORBIDDEN error code; .. and . path segments are allowed as long as they do not navigate outside of root.

Mount an app to handle all requests from this path. The path may contain parameters and these will be merged into the parameters from individual paths in the inner App. The App may have a different state type, but its Context must implement From to perform the conversion from the parent state’s Context - the inner App’s new_context won’t be called.

Attach a websocket handler to this route

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more