-
-
Notifications
You must be signed in to change notification settings - Fork 67
Server trait usability fixes #484
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…TypeParameter = ...>) to prevent intermediate types that impl the trait from not themselves allowing the default type parameter to be overridden. - Move common bounds up from implementers of the Service trait to the Service trait itself. This both reduces boilerplate and reduces the chances of a type having stricter bounds on the struct and fns (such as fn new()) than its Service trait impl, making it hard to find the cause of a bounds mismatch. - Align bounds on all middleware struct blocks to match the bounds on the Service trait impls to catch mismatched bounds earlier. - Remove unnecessary ?Sized bound on impl Service for U where U: Deref.
3d13a1d to
35a17a1
Compare
Contributor
|
@ximon18 do you feel this is ready now? (Apart from the conflicts.) |
Member
Author
|
These changes are IIRC in the patches-for-nameshed-prototype branch and so were needed by Cascade. Whether Cascade would work without them now would need testing. I think ultimately this will all be replaced by the new-xxx work. |
Philip-NLnetLabs
approved these changes
Nov 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've marked this PR as DRAFT because I need these changes for something I'm testing but I don't actually know if they are needed, or correct, at this point.
Remove defaults from trait generic type parameters (i.e.
TraitName<TypeParameter = ...>) to prevent intermediate types that impl the trait from not themselves allowing the default type parameter to be overridden.Move common bounds up from implementers of the
Servicetrait to theServicetrait itself. This both reduces boilerplate and reduces the chances of a type having stricter bounds on the struct and functions (such asfn new()) than itsServicetrait impl, making it hard to find the cause of a bounds mismatch.Align bounds on all middleware struct blocks to match the bounds on the
Servicetrait impls to catch mismatched bounds earlier.Remove unnecessary
?Sizedbound onimpl Service for U where U: Deref.