pub trait PathRouter<State = (), CurrentPathParameters = ()>: PathRouterIsSealed {
// Required method
async fn call_path_router<R: Read, W: ResponseWriter<Error = R::Error>>(
&self,
state: &State,
current_path_parameters: CurrentPathParameters,
path: Path<'_>,
request: Request<'_, R>,
response_writer: W,
) -> Result<ResponseSent, W::Error>;
}Expand description
Routes a request based on its path.
Required Methods§
Sourceasync fn call_path_router<R: Read, W: ResponseWriter<Error = R::Error>>(
&self,
state: &State,
current_path_parameters: CurrentPathParameters,
path: Path<'_>,
request: Request<'_, R>,
response_writer: W,
) -> Result<ResponseSent, W::Error>
async fn call_path_router<R: Read, W: ResponseWriter<Error = R::Error>>( &self, state: &State, current_path_parameters: CurrentPathParameters, path: Path<'_>, request: Request<'_, R>, response_writer: W, ) -> Result<ResponseSent, W::Error>
Handle the request and write the response to the provided ResponseWriter.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.