pub struct RateLimitLayer {
pub state: RateLimitState,
}Expand description
Tower layer wrapper. v0.1 exposes the RateLimitState directly;
servers call .check() in the request-handling path. A full Tower
integration is a v0.2 enhancement.
Fields§
§state: RateLimitStateRate limit state shared across request handlers.
Implementations§
Source§impl RateLimitLayer
impl RateLimitLayer
Sourcepub fn new(state: RateLimitState) -> Self
pub fn new(state: RateLimitState) -> Self
Construct a layer from RateLimitState.
Trait Implementations§
Source§impl Clone for RateLimitLayer
impl Clone for RateLimitLayer
Source§fn clone(&self) -> RateLimitLayer
fn clone(&self) -> RateLimitLayer
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 RateLimitLayer
impl !RefUnwindSafe for RateLimitLayer
impl Send for RateLimitLayer
impl Sync for RateLimitLayer
impl Unpin for RateLimitLayer
impl UnsafeUnpin for RateLimitLayer
impl !UnwindSafe for RateLimitLayer
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