pub struct TcpListener<T> { /* private fields */ }Expand description
TcpListener is used to create a TCP connection listener.
Implementations§
Source§impl<T> TcpListener<T>where
T: ToSocketAddrs + Send,
impl<T> TcpListener<T>where
T: ToSocketAddrs + Send,
Sourcepub fn new(local_addr: T) -> TcpListener<T>
pub fn new(local_addr: T) -> TcpListener<T>
Bind to socket address.
Sourcepub fn rustls<S, C, E>(
self,
config_stream: S,
) -> RustlsListener<S, C, TcpListener<T>, E>where
S: IntoConfigStream<C> + Send + 'static,
C: TryInto<ServerConfig, Error = E> + Send + 'static,
E: Error + Send,
pub fn rustls<S, C, E>(
self,
config_stream: S,
) -> RustlsListener<S, C, TcpListener<T>, E>where
S: IntoConfigStream<C> + Send + 'static,
C: TryInto<ServerConfig, Error = E> + Send + 'static,
E: Error + Send,
Creates a new RustlsListener from current TcpListener.
Sourcepub fn native_tls<S, C, E>(
self,
config_stream: S,
) -> NativeTlsListener<S, C, TcpListener<T>, E>
pub fn native_tls<S, C, E>( self, config_stream: S, ) -> NativeTlsListener<S, C, TcpListener<T>, E>
Creates a new NativeTlsListener from current TcpListener.
Sourcepub fn openssl<S, C, E>(
self,
config_stream: S,
) -> OpensslListener<S, C, TcpListener<T>, E>where
S: IntoConfigStream<C> + Send + 'static,
C: TryInto<SslAcceptorBuilder, Error = E> + Send + 'static,
E: Error + Send,
pub fn openssl<S, C, E>(
self,
config_stream: S,
) -> OpensslListener<S, C, TcpListener<T>, E>where
S: IntoConfigStream<C> + Send + 'static,
C: TryInto<SslAcceptorBuilder, Error = E> + Send + 'static,
E: Error + Send,
Creates a new OpensslListener from current TcpListener.
Sourcepub fn acme(self) -> AcmeListener<TcpListener<T>>
pub fn acme(self) -> AcmeListener<TcpListener<T>>
Creates a new AcmeListener from current TcpListener.
Sourcepub fn ttl(self, ttl: u32) -> TcpListener<T>
pub fn ttl(self, ttl: u32) -> TcpListener<T>
Sets the value for the IP_TTL option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
Sourcepub fn backlog(self, backlog: u32) -> TcpListener<T>
pub fn backlog(self, backlog: u32) -> TcpListener<T>
Set backlog capacity.
Trait Implementations§
Source§impl<T> Listener for TcpListener<T>where
T: ToSocketAddrs + Send,
impl<T> Listener for TcpListener<T>where
T: ToSocketAddrs + Send,
Auto Trait Implementations§
impl<T> Freeze for TcpListener<T>where
T: Freeze,
impl<T> RefUnwindSafe for TcpListener<T>where
T: RefUnwindSafe,
impl<T> Send for TcpListener<T>where
T: Send,
impl<T> Sync for TcpListener<T>where
T: Sync,
impl<T> Unpin for TcpListener<T>where
T: Unpin,
impl<T> UnwindSafe for TcpListener<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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