Struct gotham::router::route::RouteImpl
[−]
[src]
pub struct RouteImpl<RM, PE, QSE> where
RM: RouteMatcher,
PE: PathExtractor,
QSE: QueryStringExtractor, { /* fields omitted */ }
Concrete type for a route in a Gotham web application. Values of this type are created by the
gotham::router::builder
API and held internally in the Router
for dispatching requests.
Methods
impl<RM, PE, QSE> RouteImpl<RM, PE, QSE> where
RM: RouteMatcher,
PE: PathExtractor,
QSE: QueryStringExtractor,
[src]
RM: RouteMatcher,
PE: PathExtractor,
QSE: QueryStringExtractor,
pub fn new(
matcher: RM,
dispatcher: Box<Dispatcher + Send + Sync>,
_extractors: Extractors<PE, QSE>,
delegation: Delegation
) -> Self
[src]
matcher: RM,
dispatcher: Box<Dispatcher + Send + Sync>,
_extractors: Extractors<PE, QSE>,
delegation: Delegation
) -> Self
Creates a new RouteImpl
from the provided components.
Trait Implementations
impl<RM, PE, QSE> Route for RouteImpl<RM, PE, QSE> where
RM: RouteMatcher,
PE: PathExtractor,
QSE: QueryStringExtractor,
[src]
RM: RouteMatcher,
PE: PathExtractor,
QSE: QueryStringExtractor,
fn is_match(&self, state: &State) -> Result<(), RouteNonMatch>
[src]
Determines if this Route
should be invoked, based on the request data in `State.
fn delegation(&self) -> Delegation
[src]
Determines if this Route
intends to delegate requests to a secondary Router
instance.
ⓘImportant traits for Box<W>fn dispatch(&self, state: State) -> Box<HandlerFuture>
[src]
Dispatches the request to this Route
, which will execute the pipelines and the handler assigned to the `Route. Read more
fn extract_request_path(
&self,
state: &mut State,
segment_mapping: SegmentMapping
) -> Result<(), ExtractorFailed>
[src]
&self,
state: &mut State,
segment_mapping: SegmentMapping
) -> Result<(), ExtractorFailed>
Extracts dynamic components of the Request
path and stores the PathExtractor
in State
.
fn extend_response_on_path_error(&self, state: &mut State, res: &mut Response)
[src]
Extends the Response
object when the PathExtractor
fails.
fn extract_query_string(&self, state: &mut State) -> Result<(), ExtractorFailed>
[src]
Extracts the query string parameters and stores the QueryStringExtractor
in State
.
fn extend_response_on_query_string_error(
&self,
state: &mut State,
res: &mut Response
)
[src]
&self,
state: &mut State,
res: &mut Response
)
Extends the Response
object when query string extraction fails.