AsyncClose

Trait AsyncClose 

Source
pub trait AsyncClose: Send {
    // Required method
    fn close(self) -> impl Future<Output = ()> + Send;
}

Required Methods§

Source

fn close(self) -> impl Future<Output = ()> + Send

Asynchronously closes the associated resource.

For senders, this typically means dropping the sender to signal the end of the message stream.

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.

Implementations on Foreign Types§

Source§

impl<T: Send> AsyncClose for Sender<T>

Source§

async fn close(self)

Source§

impl<T: Send> AsyncClose for UnboundedSender<T>

Source§

async fn close(self)

Implementors§