1
0
mirror of https://github.com/actix/actix-website synced 2024-11-24 00:41:07 +01:00

Update handlers.md (#157)

* Update handlers.md

Links updated to 2.0, one duplicate was removed.
This commit is contained in:
Nikita Puzankov 2020-02-03 23:31:18 +04:00 committed by GitHub
parent 99d057e31d
commit 64e8477236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ weight: 160
A request handler is an async function that accepts zero or more parameters that can be extracted A request handler is an async function that accepts zero or more parameters that can be extracted
from a request (ie, [*impl FromRequest*][implfromrequest]) and returns a type that can from a request (ie, [*impl FromRequest*][implfromrequest]) and returns a type that can
be converted into an HttpResponse (ie, [*impl Responder*][implresponder]). be converted into an HttpResponse (ie, [*impl Responder*][respondertrait]).
Request handling happens in two stages. First the handler object is called, returning any Request handling happens in two stages. First the handler object is called, returning any
object that implements the [*Responder*][respondertrait] trait. Then, `respond_to()` is object that implements the [*Responder*][respondertrait] trait. Then, `respond_to()` is
@ -73,8 +73,7 @@ different responder types into a single type.
{{< include-example example="either" file="main.rs" section="either" >}} {{< include-example example="either" file="main.rs" section="either" >}}
[implfromrequest]: https://docs.rs/actix-web/1.0.2/actix_web/trait.FromRequest.html [implfromrequest]: https://docs.rs/actix-web/2/actix_web/trait.FromRequest.html
[implresponder]: https://docs.rs/actix-web/1.0.2/actix_web/trait.Responder.html [respondertrait]: https://docs.rs/actix-web/2/actix_web/trait.Responder.html
[respondertrait]: https://docs.rs/actix-web/1.0.2/actix_web/trait.Responder.html [responderimpls]: https://docs.rs/actix-web/2/actix_web/trait.Responder.html#foreign-impls
[responderimpls]: https://docs.rs/actix-web/1.0.2/actix_web/trait.Responder.html#foreign-impls [either]: https://docs.rs/actix-web/2/actix_web/enum.Either.html
[either]: https://docs.rs/actix-web/1.0.2/actix_web/enum.Either.html