pub trait BindEndpoint<S: ?Sized>: Send + Sync {
type Listener: Send;
// Required method
fn bind(
&self,
scheduler: &S,
options: BindOptions,
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<Vec<Self::Listener>>> + Send;
}Expand description
A reusable description of how to create listeners. Consumers need not know how addresses are resolved or sockets are created. Binding may produce multiple listeners, for example one per IP family.
Required Associated Types§
Required Methods§
Sourcefn bind(
&self,
scheduler: &S,
options: BindOptions,
cancellation: &Cancellation,
) -> impl Future<Output = OperationResult<Vec<Self::Listener>>> + Send
fn bind( &self, scheduler: &S, options: BindOptions, cancellation: &Cancellation, ) -> impl Future<Output = OperationResult<Vec<Self::Listener>>> + Send
Bind and start listening on every address. Success returns a nonempty collection; failure transfers no listeners to the caller. Futures are lazy. Await completion after cooperative cancellation to finish asynchronous rollback; dropping a pending future provides ordinary destruction only.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".