pub struct RateLimitMiddleware { /* private fields */ }Expand description
Rate limiting middleware with improved error handling
Implementations§
Source§impl RateLimitMiddleware
impl RateLimitMiddleware
pub fn new(max_requests_per_minute: u32) -> RateLimitMiddleware
Trait Implementations§
Source§impl TransportMiddleware for RateLimitMiddleware
impl TransportMiddleware for RateLimitMiddleware
Source§fn process_outgoing<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RateLimitMiddleware: 'async_trait,
fn process_outgoing<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RateLimitMiddleware: 'async_trait,
Process outgoing message
Source§fn process_incoming<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RateLimitMiddleware: 'async_trait,
fn process_incoming<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RateLimitMiddleware: 'async_trait,
Process incoming message
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