Skip to main content

SinkCloseChannel

Trait SinkCloseChannel 

Source
pub trait SinkCloseChannel<T>: Sink<T> {
    // Required method
    fn close_channel(self: Pin<&mut Self>);
}
Expand description

A Sink with a close_channel method like futures::channel::mpsc::Sender’s.

Required Methods§

Source

fn close_channel(self: Pin<&mut Self>)

Close the channel from the sending end, giving EOF at the receiver

Future attempts to send will get a disconnected error.

This closes all equivalent senders for the underlying data sink. For example, if Self is Clone, all clones are affected.

If the Sink is for a channel, the receiver will see EOF after reading the messages that were successfully sent so far.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> SinkCloseChannel<T> for Sender<T>

Source§

fn close_channel(self: Pin<&mut Self>)

Implementors§