Struct actix_web::dev::Router
[−]
[src]
pub struct Router(_);
Interface for application router.
Methods
impl Router
[src]
fn new<S>(
prefix: &str,
settings: ServerSettings,
map: Vec<(Pattern, Option<Resource<S>>)>
) -> (Router, Vec<Resource<S>>)
[src]
prefix: &str,
settings: ServerSettings,
map: Vec<(Pattern, Option<Resource<S>>)>
) -> (Router, Vec<Resource<S>>)
Create new router
fn prefix(&self) -> &str
[src]
Router prefix
fn server_settings(&self) -> &ServerSettings
[src]
Server settings
fn recognize<S>(&self, req: &mut HttpRequest<S>) -> Option<usize>
[src]
Query for matched resource
fn has_route(&self, path: &str) -> bool
[src]
Check if application contains matching route.
This method does not take prefix
into account.
For example if prefix is /test
and router contains route /name
,
following path would be recognizable /test/name
but has_route()
call
would return false
.
fn resource_path<U, I>(
&self,
name: &str,
elements: U
) -> Result<String, UrlGenerationError> where
U: IntoIterator<Item = I>,
I: AsRef<str>,
[src]
&self,
name: &str,
elements: U
) -> Result<String, UrlGenerationError> where
U: IntoIterator<Item = I>,
I: AsRef<str>,
Build named resource path.
Check HttpRequest::url_for()
for detailed information.