pub struct RateLimitMiddleware { /* private fields */ }Expand description
A middleware for rate limiting requests.
Implementations§
Source§impl RateLimitMiddleware
impl RateLimitMiddleware
Sourcepub fn builder() -> RateLimitMiddlewareBuilder
pub fn builder() -> RateLimitMiddlewareBuilder
Creates a new RateLimitMiddlewareBuilder.
Trait Implementations§
Source§impl<C: Send + Sync> Middleware<C> for RateLimitMiddleware
impl<C: Send + Sync> Middleware<C> for RateLimitMiddleware
fn name(&self) -> &str
fn process_request<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_client: &'life1 C,
request: Request,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_response<'life0, 'async_trait>(
&'life0 mut self,
response: Response,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Response>, SpiderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_request: &'life1 Request,
error: &'life2 SpiderError,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareAction<Request>, SpiderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for RateLimitMiddleware
impl !RefUnwindSafe for RateLimitMiddleware
impl Send for RateLimitMiddleware
impl Sync for RateLimitMiddleware
impl Unpin for RateLimitMiddleware
impl !UnwindSafe for RateLimitMiddleware
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