You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the K generic and Box key_extractor to Box<dyn KeyExtractor>, or at very least impl KeyExtractor for Box<T> where T: KeyExtractor (and maybe for Arc<T> too), to allow people to have unified GovernorConfig<Box<dyn KeyExtractor>> that can have runtime-conditional key extractor.
The text was updated successfully, but these errors were encountered:
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 impl KeyExtractor.
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: