pub struct StaticApiKeyConfig {
pub key_configs: HashMap<String, BarnacleConfig>,
pub default_config: BarnacleConfig,
}
Expand description
Per-key rate limiting configuration for static configurations
Fields§
§key_configs: HashMap<String, BarnacleConfig>
§default_config: BarnacleConfig
Implementations§
Source§impl StaticApiKeyConfig
impl StaticApiKeyConfig
pub fn new(default_config: BarnacleConfig) -> Self
pub fn with_key_config(self, api_key: String, config: BarnacleConfig) -> Self
pub fn get_config_for_key(&self, api_key: &str) -> &BarnacleConfig
Trait Implementations§
Source§impl Clone for StaticApiKeyConfig
impl Clone for StaticApiKeyConfig
Source§fn clone(&self) -> StaticApiKeyConfig
fn clone(&self) -> StaticApiKeyConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for StaticApiKeyConfig
impl RefUnwindSafe for StaticApiKeyConfig
impl Send for StaticApiKeyConfig
impl Sync for StaticApiKeyConfig
impl Unpin for StaticApiKeyConfig
impl UnwindSafe for StaticApiKeyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more