pub struct AccessLimit<P: ProtocolHandler + Clone> { /* private fields */ }Expand description
Wraps an existing protocol, limiting its access, based on the provided function.
Any refused connection will be closed with an error code of 0 and reason not allowed.
Implementations§
Source§impl<P: ProtocolHandler + Clone> AccessLimit<P>
impl<P: ProtocolHandler + Clone> AccessLimit<P>
Trait Implementations§
Source§impl<P: Clone + ProtocolHandler + Clone> Clone for AccessLimit<P>
impl<P: Clone + ProtocolHandler + Clone> Clone for AccessLimit<P>
Source§fn clone(&self) -> AccessLimit<P>
fn clone(&self) -> AccessLimit<P>
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 moreSource§impl<P> Debug for AccessLimit<P>
impl<P> Debug for AccessLimit<P>
Source§impl<P: ProtocolHandler + Clone> ProtocolHandler for AccessLimit<P>
impl<P: ProtocolHandler + Clone> ProtocolHandler for AccessLimit<P>
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> impl Future<Output = Result<Connection, AcceptError>> + Send
fn on_accepting( &self, accepting: Accepting, ) -> impl Future<Output = Result<Connection, AcceptError>> + Send
Optional interception point to handle the
Accepting state. Read moreSource§async fn accept(&self, conn: Connection) -> Result<(), AcceptError>
async fn accept(&self, conn: Connection) -> Result<(), AcceptError>
Handle an incoming connection. Read more
Auto Trait Implementations§
impl<P> Freeze for AccessLimit<P>where
P: Freeze,
impl<P> !RefUnwindSafe for AccessLimit<P>
impl<P> Send for AccessLimit<P>
impl<P> Sync for AccessLimit<P>
impl<P> Unpin for AccessLimit<P>where
P: Unpin,
impl<P> !UnwindSafe for AccessLimit<P>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
Source§fn accept(
&self,
connection: Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
fn accept( &self, connection: Connection, ) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
fn on_accepting( &self, accepting: Accepting, ) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more