Skip to main content

SocketClose

Trait SocketClose 

Source
pub trait SocketClose: SocketOperation {
    // Required methods
    fn socket_close(
        &self,
        socket: Self::Socket,
    ) -> impl Future<Output = Result<()>> + Send;
    fn socket_close_submit(
        &self,
        socket: Self::Socket,
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Consume and close an exclusively owned socket through the scheduler.

Required Methods§

Source

fn socket_close( &self, socket: Self::Socket, ) -> impl Future<Output = Result<()>> + Send

Consume and close an exclusively owned socket, awaiting bounded admission and OS completion. Finish all other operations first: close never cancels or joins them, and retained backend use may panic. Dropping an unpolled close releases the owned descriptor through its ordinary destructor.

Source

fn socket_close_submit( &self, socket: Self::Socket, ) -> impl Future<Output = Result<()>> + Send

Consume the socket and await bounded cleanup admission only. Accepted close jobs survive waiter abandonment and are drained during graceful scheduler shutdown. Execution errors are discarded; use socket_close to observe them. The same exclusive-ownership requirement applies.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§