-
Notifications
You must be signed in to change notification settings - Fork 23
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
KeyExtractor generic parameter makes conditional runtime handling difficult #31
Comments
Oh, I tried to impl |
Hmm, if my understanding of Arc and dyn is correct, that thing should be object safe, and Clone. Can you provide a minimal example? I'm also wondering if you've tried |
: Clone implies BTW. I have worked it around. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my app I'd like the user to have an option to rate-limit based on IP (if running in a standalone mode), or reverse proxy headers. However currently conditionally setting the extractor makes the types be incompatible.
Seems to me like either
GovernorConfig
should drop theK
generic andBox
key_extractor toBox<dyn KeyExtractor>
, or at very leastimpl KeyExtractor for Box<T> where T: KeyExtractor
(and maybe forArc<T>
too), to allow people to have unifiedGovernorConfig<Box<dyn KeyExtractor>>
that can have runtime-conditional key extractor.The text was updated successfully, but these errors were encountered: