pub trait ProviderServer: Sized + Send {
type Stream: ProviderStream;
// Required methods
fn bind(
options: &ServerOptions,
) -> impl Future<Output = Result<Self>> + Send;
fn accept(
&mut self,
) -> impl Future<Output = Result<Poll<(Self::Stream, SocketAddr)>>> + Send;
fn local_addr(&self) -> Result<SocketAddr>;
// Provided method
fn start(
options: ServerOptions,
service: Service<Handler>,
statistics: Statistics,
exchanger: Exchanger,
) -> impl Future<Output = Result<()>> + Send { ... }
}Required Associated Types§
type Stream: ProviderStream
Required Methods§
Sourcefn bind(options: &ServerOptions) -> impl Future<Output = Result<Self>> + Send
fn bind(options: &ServerOptions) -> impl Future<Output = Result<Self>> + Send
Bind the server to the specified address.
Sourcefn accept(
&mut self,
) -> impl Future<Output = Result<Poll<(Self::Stream, SocketAddr)>>> + Send
fn accept( &mut self, ) -> impl Future<Output = Result<Poll<(Self::Stream, SocketAddr)>>> + Send
Accept a new connection.
Sourcefn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
Get the local address of the listener.
Provided Methods§
Sourcefn start(
options: ServerOptions,
service: Service<Handler>,
statistics: Statistics,
exchanger: Exchanger,
) -> impl Future<Output = Result<()>> + Send
fn start( options: ServerOptions, service: Service<Handler>, statistics: Statistics, exchanger: Exchanger, ) -> impl Future<Output = Result<()>> + Send
Start the server.
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.