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.

Implementations on Foreign Types§

Source§

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

Source§

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

Implementors§

impl<T, C> SinkCloseChannel<T> for Sender<T, C>
where T: HasMemoryCost + Debug + Send, C: ChannelSpec, C::Sender<Entry<T>>: SinkCloseChannel<Entry<T>>,