Struct salvo::prelude::TcpListener
source · 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
.
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