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

Rename factory to handler #1852

Merged
merged 8 commits into from
Dec 26, 2020
Merged

Rename factory to handler #1852

merged 8 commits into from
Dec 26, 2020

Conversation

ibraheemdev
Copy link
Member

@ibraheemdev ibraheemdev commented Dec 25, 2020

PR Type

Refactor

PR Checklist

  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt

Overview

This PR renames the Factory trait to Handler, and the Handler struct to HandlerService. This change better reflects the purpose of these types.

The trait Factory is not satisfied is a common error that has caused a lot of confusion as it is pretty cryptic. The trait Handler is not satisfied makes more sense. I also added documentation listing the requirements of a valid handler.

This is a breaking change (even users aren't really meant to implement Factory manually), but is important for ergonomics.

I also removed the third type parameter (O) from Handler which simplifies the type definition overall.

@robjtede robjtede added A-web project: actix-web B-semver-patch labels Dec 25, 2020
@robjtede robjtede requested a review from a team December 26, 2020 01:11
@robjtede robjtede added B-semver-major breaking change requiring a major version bump and removed B-semver-patch labels Dec 26, 2020
@robjtede
Copy link
Member

Add changelog entry.

Rename Handler to HandlerService and rename Factory to Handler.

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-major breaking change requiring a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants