pub struct Limit<const COUNT: usize, const PER: u64, K>(pub K::Extractor)
where
K: Key;Expand description
Represents a rate limit configuration with generic parameters for count and time period.
This struct uses generics to allow flexible integration with any extractor that implements the Key trait.
Tuple Fields§
§0: K::ExtractorImplementations§
Source§impl<const COUNT: usize, const PER: u64, K> Limit<COUNT, PER, K>where
K: Key,
impl<const COUNT: usize, const PER: u64, K> Limit<COUNT, PER, K>where
K: Key,
Trait Implementations§
Source§impl<const COUNT: usize, const PER: u64, K> AsMut<<K as Key>::Extractor> for Limit<COUNT, PER, K>where
K: Key,
impl<const COUNT: usize, const PER: u64, K> AsMut<<K as Key>::Extractor> for Limit<COUNT, PER, K>where
K: Key,
Source§impl<const COUNT: usize, const PER: u64, K> AsRef<<K as Key>::Extractor> for Limit<COUNT, PER, K>where
K: Key,
impl<const COUNT: usize, const PER: u64, K> AsRef<<K as Key>::Extractor> for Limit<COUNT, PER, K>where
K: Key,
Source§impl<const C: usize, const P: u64, K, S> FromRequestParts<S> for Limit<C, P, K>
impl<const C: usize, const P: u64, K, S> FromRequestParts<S> for Limit<C, P, K>
Source§type Rejection = LimitRejection<<<K as Key>::Extractor as FromRequestParts<S>>::Rejection>
type Rejection = LimitRejection<<<K as Key>::Extractor as FromRequestParts<S>>::Rejection>
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
impl<const COUNT: usize, const PER: u64, K> Copy for Limit<COUNT, PER, K>
Auto Trait Implementations§
impl<const COUNT: usize, const PER: u64, K> Freeze for Limit<COUNT, PER, K>
impl<const COUNT: usize, const PER: u64, K> RefUnwindSafe for Limit<COUNT, PER, K>
impl<const COUNT: usize, const PER: u64, K> Send for Limit<COUNT, PER, K>
impl<const COUNT: usize, const PER: u64, K> Sync for Limit<COUNT, PER, K>
impl<const COUNT: usize, const PER: u64, K> Unpin for Limit<COUNT, PER, K>
impl<const COUNT: usize, const PER: u64, K> UnwindSafe for Limit<COUNT, PER, K>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.