4 Commits

Author SHA1 Message Date
David Pedersen
77760198f1
docs: add "Building a middleware from scratch" guide (#590)
This adds a guide that explains how to implement a middleware from scratch without taking any shortcuts. It walks through implementing `Timeout` as it exists in Tower today.

The hope is that once users have read [the previous guide](https://tokio.rs/blog/2021-05-14-inventing-the-service-trait) followed by this one they should be fully equipped to implement their own middleware.
2021-06-07 11:06:30 +02:00
David Pedersen
ce2f031523
docs: guide moved to tokio.rs (#588) 2021-05-18 14:35:19 +02:00
David Pedersen
31d5a6652a
Fix a couple of typos in the guide (#586) 2021-05-17 19:36:04 +02:00
David Pedersen
5e0c8da260
docs: Add "Inventing the Service trait" guide (#585)
This adds the first Tower guide called "Inventing the `Service` trait". It attempts to motivate all the parts to `Service` by walking the user through how they could have invented `Service` themselves, from scratch. It goes into quite a bit of detail but hopefully it paints a somewhat complete picture in the end.

The next guide I want to write is about how to implement a proper `Timeout` middleware using `Layer`, pin-project, and all the bells and whistles.

Ref: https://github.com/tower-rs/tower/issues/33
2021-05-14 22:59:43 +02:00