Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide documentation in the middleware module #3070

Merged
merged 5 commits into from
Jul 19, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jul 13, 2023

PR Type

Other/Documentation

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

As explained in #3026, this provides documentation about middleware in the middleware module. I took the example and parts of the explanation from actix.rs/docs/middleware. I added a section on the traits and the order of middleware.

Furthermore, I looked at the authors-guide.md and tried to include some sections from there. I'm still missing "Understanding Body Types", "Best Practices", "Error Propagation", and "When To (Not) Use Middleware". Should I include these in this PR?

Since the middleware section now contains an example, should the documentation for Transform link to it and/or should the example there be removed/changed?

Closes #3026

@robjtede robjtede added A-web project: actix-web B-semver-norelease change that does not require a release labels Jul 19, 2023
@robjtede
Copy link
Member

robjtede commented Jul 19, 2023

I cannot thank you enough for getting this kicked off. I've been dreading writing this out but this is a fantastic basis and deserves to be merged ASAP.

I've gone over it, making mostly mechanical changes. The exception is that I've replaced the section on wrap_fn with some notes about the from_fn helper from actix-web-lab as it's more the direction we want to point newcomers, more capable, and much easier to use.

This gives me motivation to flesh out the remaining sections in authors-guide.md file using this as a base. Thanks again. (Seriously, beer on me if you come to EuroRust 😛)

@robjtede robjtede enabled auto-merge (squash) July 19, 2023 02:48
@robjtede robjtede merged commit b061f00 into actix:master Jul 19, 2023
12 checks passed
@Nerixyz Nerixyz deleted the docs/middleware branch July 19, 2023 10:44
@robjtede robjtede added this to the actix-web v4.4 milestone Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-norelease change that does not require a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Documentation For Implementing Middleware in Rustdoc
2 participants