pub trait _:
Sized
+ Send
+ Sync
+ Sealed {
type Stream: Stream;
// Required methods
fn from_options(options: ListenerOptions<'_>) -> Result<Self, Error>;
fn accept(
&self,
) -> impl Future<Output = Result<Self::Stream, Error>> + Send + Sync;
fn do_not_reclaim_name_on_drop(&mut self);
}Expand description
Tokio local socket server implementations.
Types on which this trait is implemented are variants of the
Listener enum. In addition, it is implemented on Listener itself,
which makes it a trait object of sorts. See its documentation for more on the semantics of the
methods seen here.
Required Associated Types§
Required Methods§
Sourcefn from_options(options: ListenerOptions<'_>) -> Result<Self, Error>
fn from_options(options: ListenerOptions<'_>) -> Result<Self, Error>
Creates a socket server using the specified options.
Sourcefn accept(
&self,
) -> impl Future<Output = Result<Self::Stream, Error>> + Send + Sync
fn accept( &self, ) -> impl Future<Output = Result<Self::Stream, Error>> + Send + Sync
Asynchronously listens for incoming connections to the socket, returning a future that finishes only when a client is connected.
Sourcefn do_not_reclaim_name_on_drop(&mut self)
fn do_not_reclaim_name_on_drop(&mut self)
Disables name reclamation on the listener.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.