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:
parent
99d057e31d
commit
64e8477236
@ -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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user