1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-13 10:49:26 +00:00

doc string

This commit is contained in:
Nikolay Kim 2017-10-16 19:40:11 -07:00
parent e55e08d204
commit 774de4b44a

View file

@ -46,19 +46,19 @@ impl Router {
/// Request routing map builder
///
/// Resource may have variable path also. For instance, a resource with
/// the path '/a/{name}/c' would match all incoming requests with paths
/// such as '/a/b/c', '/a/1/c', and '/a/etc/c'.
/// the path */a/{name}/c* would match all incoming requests with paths
/// such as */a/b/c*, */a/1/c*, and */a/etc/c*.
///
/// A variable part is specified in the form {identifier}, where
/// A variable part is specified in the form `{identifier}`, where
/// the identifier can be used later in a request handler to access the matched
/// value for that part. This is done by looking up the identifier
/// in the Params object returned by `Request.match_info()` method.
///
/// By default, each part matches the regular expression [^{}/]+.
/// By default, each part matches the regular expression `[^{}/]+`.
///
/// You can also specify a custom regex in the form {identifier:regex}:
/// You can also specify a custom regex in the form `{identifier:regex}`:
///
/// For instance, to route Get requests on any route matching /users/{userid}/{friend} and
/// For instance, to route Get requests on any route matching `/users/{userid}/{friend}` and
/// store userid and friend in the exposed Params object:
///
/// ```rust,ignore
@ -98,7 +98,7 @@ impl RoutingMap {
/// let mut router =
/// RoutingMap::default()
/// .app("/pre", Application::default()
/// .resource("/test", |r| {
/// .resource("/users/{userid}", |r| {
/// r.get::<MyRoute>();
/// r.post::<MyRoute>();
/// })