pub struct ConnLimiter<T> { /* private fields */ }Expand description
Return type of ListenerExt::limit_connections.
See that method for details.
Trait Implementations§
Source§impl<T> Debug for ConnLimiter<T>where
T: Debug,
impl<T> Debug for ConnLimiter<T>where
T: Debug,
Source§impl<T> Listener for ConnLimiter<T>where
T: Listener,
impl<T> Listener for ConnLimiter<T>where
T: Listener,
Source§async fn accept(
&mut self,
) -> (<ConnLimiter<T> as Listener>::Io, <ConnLimiter<T> as Listener>::Addr)
async fn accept( &mut self, ) -> (<ConnLimiter<T> as Listener>::Io, <ConnLimiter<T> as Listener>::Addr)
Accept a new incoming connection to this listener. Read more
Source§fn local_addr(&self) -> Result<<ConnLimiter<T> as Listener>::Addr, Error>
fn local_addr(&self) -> Result<<ConnLimiter<T> as Listener>::Addr, Error>
Returns the local address that this listener is bound to.
Auto Trait Implementations§
impl<T> Freeze for ConnLimiter<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConnLimiter<T>where
T: RefUnwindSafe,
impl<T> Send for ConnLimiter<T>where
T: Send,
impl<T> Sync for ConnLimiter<T>where
T: Sync,
impl<T> Unpin for ConnLimiter<T>where
T: Unpin,
impl<T> UnsafeUnpin for ConnLimiter<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ConnLimiter<T>where
T: UnwindSafe,
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<L> ListenerExt for Lwhere
L: Listener,
impl<L> ListenerExt for Lwhere
L: Listener,
Source§fn limit_connections(self, limit: usize) -> ConnLimiter<Self>
fn limit_connections(self, limit: usize) -> ConnLimiter<Self>
Limit the number of concurrent connections. Once the limit has
been reached, no additional connections will be accepted until
an existing connection is closed. Listener implementations will
typically continue to queue incoming connections, up to an OS
and implementation-specific listener backlog limit. Read more