pub trait Sink<Item> {
type Error;
// Required methods
fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>;
fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
}Expand description
A Sink is a value into which other values can be sent, asynchronously.
Basic examples of sinks include the sending side of:
- Channels
- Sockets
- Pipes
In addition to such “primitive” sinks, it’s typical to layer additional functionality, such as buffering, on top of an existing sink.
Sending to a sink is “asynchronous” in the sense that the value may not be sent in its entirety immediately. Instead, values are sent in a two-phase way: first by initiating a send, and then by polling for completion. This two-phase setup is analogous to buffered writing in synchronous code, where writes often succeed immediately, but internally are buffered and are actually written only upon flushing.
In addition, the Sink may be full, in which case it is not even possible
to start the sending process.
As with Future and Stream, the Sink trait is built from a few core
required methods, and a host of default methods for working in a
higher-level way. The Sink::send_all combinator is of particular
importance: you can use it to send an entire stream to a sink, which is
the simplest way to ultimately consume a stream.
Required Associated Types§
Required Methods§
Sourcefn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the Sink to receive a value.
This method must be called and return Poll::Ready(Ok(())) prior to
each call to start_send.
This method returns Poll::Ready once the underlying sink is ready to
receive data. If this method returns Poll::Pending, the current task
is registered to be notified (via cx.waker().wake_by_ref()) when poll_ready
should be called again.
In most cases, if the sink encounters an error, the sink will permanently be unable to receive items.
Sourcefn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready which returned Poll::Ready(Ok(())).
As the name suggests, this method only begins the process of sending
the item. If the sink employs buffering, the item isn’t fully processed
until the buffer is fully flushed. Since sinks are designed to work with
asynchronous I/O, the process of actually writing out the data to an
underlying object takes place asynchronously. You must use
poll_flush or poll_close in order to guarantee completion of a
send.
Implementations of poll_ready and start_send will usually involve
flushing behind the scenes in order to make room for new messages.
It is only necessary to call poll_flush if you need to guarantee that
all of the items placed into the Sink have been sent.
In most cases, if the sink encounters an error, the sink will permanently be unable to receive items.
Sourcefn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Flush any remaining output from this sink.
Returns Poll::Ready(Ok(())) when no buffered items remain. If this
value is returned then it is guaranteed that all previous values sent
via start_send have been flushed.
Returns Poll::Pending if there is more work left to do, in which
case the current task is scheduled (via cx.waker().wake_by_ref()) to wake up when
poll_flush should be called again.
In most cases, if the sink encounters an error, the sink will permanently be unable to receive items.
Sourcefn poll_close(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_close( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Flush any remaining output and close this sink, if necessary.
Returns Poll::Ready(Ok(())) when no buffered items remain and the sink
has been successfully closed.
Returns Poll::Pending if there is more work left to do, in which
case the current task is scheduled (via cx.waker().wake_by_ref()) to wake up when
poll_close should be called again.
If this function encounters an error, the sink should be considered to
have failed permanently, and no more Sink methods should be called.
Implementations on Foreign Types§
Source§impl<A, B, Item> Sink<Item> for Either<A, B>
impl<A, B, Item> Sink<Item> for Either<A, B>
type Error = <A as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Either<A, B>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Either<A, B> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Either<A, B>>, item: Item, ) -> Result<(), <Either<A, B> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Either<A, B>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Either<A, B> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Either<A, B>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Either<A, B> as Sink<Item>>::Error>>
Source§impl<P, Item> Sink<Item> for Pin<P>
impl<P, Item> Sink<Item> for Pin<P>
type Error = <<P as Deref>::Target as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Pin<P>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Pin<P> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Pin<P>>, item: Item, ) -> Result<(), <Pin<P> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Pin<P>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Pin<P> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Pin<P>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Pin<P> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for Filter<S, Fut, F>
impl<S, Fut, F, Item> Sink<Item> for Filter<S, Fut, F>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Filter<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Filter<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Filter<S, Fut, F>>, item: Item, ) -> Result<(), <Filter<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Filter<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Filter<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Filter<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Filter<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for FilterMap<S, Fut, F>
impl<S, Fut, F, Item> Sink<Item> for FilterMap<S, Fut, F>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut FilterMap<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <FilterMap<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut FilterMap<S, Fut, F>>, item: Item, ) -> Result<(), <FilterMap<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut FilterMap<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <FilterMap<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut FilterMap<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <FilterMap<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for Scan<S, S, Fut, F>
impl<S, Fut, F, Item> Sink<Item> for Scan<S, S, Fut, F>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Scan<S, S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Scan<S, S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Scan<S, S, Fut, F>>, item: Item, ) -> Result<(), <Scan<S, S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Scan<S, S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Scan<S, S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Scan<S, S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Scan<S, S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for SkipWhile<S, Fut, F>
impl<S, Fut, F, Item> Sink<Item> for SkipWhile<S, Fut, F>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut SkipWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SkipWhile<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut SkipWhile<S, Fut, F>>, item: Item, ) -> Result<(), <SkipWhile<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut SkipWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SkipWhile<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut SkipWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SkipWhile<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for TakeWhile<S, Fut, F>
impl<S, Fut, F, Item> Sink<Item> for TakeWhile<S, Fut, F>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut TakeWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TakeWhile<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TakeWhile<S, Fut, F>>, item: Item, ) -> Result<(), <TakeWhile<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TakeWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TakeWhile<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TakeWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TakeWhile<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for Then<S, Fut, F>where
S: Sink<Item>,
impl<S, Fut, F, Item> Sink<Item> for Then<S, Fut, F>where
S: Sink<Item>,
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Then<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Then<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Then<S, Fut, F>>, item: Item, ) -> Result<(), <Then<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Then<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Then<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Then<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Then<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for AndThen<S, Fut, F>where
S: Sink<Item>,
impl<S, Fut, F, Item> Sink<Item> for AndThen<S, Fut, F>where
S: Sink<Item>,
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut AndThen<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <AndThen<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut AndThen<S, Fut, F>>, item: Item, ) -> Result<(), <AndThen<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut AndThen<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <AndThen<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut AndThen<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <AndThen<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for OrElse<S, Fut, F>where
S: Sink<Item>,
impl<S, Fut, F, Item> Sink<Item> for OrElse<S, Fut, F>where
S: Sink<Item>,
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut OrElse<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <OrElse<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut OrElse<S, Fut, F>>, item: Item, ) -> Result<(), <OrElse<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut OrElse<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <OrElse<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut OrElse<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <OrElse<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item> Sink<Item> for TryFilterMap<S, Fut, F>where
S: Sink<Item>,
impl<S, Fut, F, Item> Sink<Item> for TryFilterMap<S, Fut, F>where
S: Sink<Item>,
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut TryFilterMap<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFilterMap<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryFilterMap<S, Fut, F>>, item: Item, ) -> Result<(), <TryFilterMap<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryFilterMap<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFilterMap<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryFilterMap<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFilterMap<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item, E> Sink<Item> for TryFilter<S, Fut, F>
impl<S, Fut, F, Item, E> Sink<Item> for TryFilter<S, Fut, F>
type Error = E
fn poll_ready( self: Pin<&mut TryFilter<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFilter<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryFilter<S, Fut, F>>, item: Item, ) -> Result<(), <TryFilter<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryFilter<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFilter<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryFilter<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFilter<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item, E> Sink<Item> for TrySkipWhile<S, Fut, F>
impl<S, Fut, F, Item, E> Sink<Item> for TrySkipWhile<S, Fut, F>
type Error = E
fn poll_ready( self: Pin<&mut TrySkipWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TrySkipWhile<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TrySkipWhile<S, Fut, F>>, item: Item, ) -> Result<(), <TrySkipWhile<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TrySkipWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TrySkipWhile<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TrySkipWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TrySkipWhile<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, F, Item, E> Sink<Item> for TryTakeWhile<S, Fut, F>
impl<S, Fut, F, Item, E> Sink<Item> for TryTakeWhile<S, Fut, F>
type Error = E
fn poll_ready( self: Pin<&mut TryTakeWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryTakeWhile<S, Fut, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryTakeWhile<S, Fut, F>>, item: Item, ) -> Result<(), <TryTakeWhile<S, Fut, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryTakeWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryTakeWhile<S, Fut, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryTakeWhile<S, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryTakeWhile<S, Fut, F> as Sink<Item>>::Error>>
Source§impl<S, Fut, Item> Sink<Item> for TakeUntil<S, Fut>
impl<S, Fut, Item> Sink<Item> for TakeUntil<S, Fut>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut TakeUntil<S, Fut>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TakeUntil<S, Fut> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TakeUntil<S, Fut>>, item: Item, ) -> Result<(), <TakeUntil<S, Fut> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TakeUntil<S, Fut>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TakeUntil<S, Fut> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TakeUntil<S, Fut>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TakeUntil<S, Fut> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for &mut S
impl<S, Item> Sink<Item> for &mut S
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut &mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), <&mut S as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut &mut S>, item: Item, ) -> Result<(), <&mut S as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut &mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), <&mut S as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut &mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), <&mut S as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Box<S>
impl<S, Item> Sink<Item> for Box<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Box<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Box<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Box<S>>, item: Item, ) -> Result<(), <Box<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Box<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Box<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Box<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Box<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for BufferUnordered<S>
impl<S, Item> Sink<Item> for BufferUnordered<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut BufferUnordered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <BufferUnordered<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut BufferUnordered<S>>, item: Item, ) -> Result<(), <BufferUnordered<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut BufferUnordered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <BufferUnordered<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut BufferUnordered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <BufferUnordered<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Buffered<S>
impl<S, Item> Sink<Item> for Buffered<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Buffered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Buffered<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Buffered<S>>, item: Item, ) -> Result<(), <Buffered<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Buffered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Buffered<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Buffered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Buffered<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Chunks<S>
impl<S, Item> Sink<Item> for Chunks<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Chunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Chunks<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Chunks<S>>, item: Item, ) -> Result<(), <Chunks<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Chunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Chunks<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Chunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Chunks<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Enumerate<S>
impl<S, Item> Sink<Item> for Enumerate<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Enumerate<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Enumerate<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Enumerate<S>>, item: Item, ) -> Result<(), <Enumerate<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Enumerate<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Enumerate<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Enumerate<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Enumerate<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Fuse<S>
impl<S, Item> Sink<Item> for Fuse<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Fuse<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Fuse<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Fuse<S>>, item: Item, ) -> Result<(), <Fuse<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Fuse<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Fuse<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Fuse<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Fuse<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Peekable<S>
impl<S, Item> Sink<Item> for Peekable<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Peekable<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Peekable<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Peekable<S>>, item: Item, ) -> Result<(), <Peekable<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Peekable<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Peekable<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Peekable<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Peekable<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for ReadyChunks<S>
impl<S, Item> Sink<Item> for ReadyChunks<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut ReadyChunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <ReadyChunks<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut ReadyChunks<S>>, item: Item, ) -> Result<(), <ReadyChunks<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut ReadyChunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <ReadyChunks<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut ReadyChunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <ReadyChunks<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Skip<S>
impl<S, Item> Sink<Item> for Skip<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Skip<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Skip<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Skip<S>>, item: Item, ) -> Result<(), <Skip<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Skip<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Skip<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Skip<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Skip<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for SplitSink<S, Item>where
S: Sink<Item>,
impl<S, Item> Sink<Item> for SplitSink<S, Item>where
S: Sink<Item>,
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut SplitSink<S, Item>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <S as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut SplitSink<S, Item>>, item: Item, ) -> Result<(), <S as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut SplitSink<S, Item>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <S as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut SplitSink<S, Item>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <S as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for Take<S>
impl<S, Item> Sink<Item> for Take<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Take<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Take<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Take<S>>, item: Item, ) -> Result<(), <Take<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Take<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Take<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Take<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Take<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for IntoStream<S>where
S: Sink<Item>,
impl<S, Item> Sink<Item> for IntoStream<S>where
S: Sink<Item>,
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut IntoStream<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <IntoStream<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut IntoStream<S>>, item: Item, ) -> Result<(), <IntoStream<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut IntoStream<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <IntoStream<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut IntoStream<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <IntoStream<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for TryChunks<S>
impl<S, Item> Sink<Item> for TryChunks<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut TryChunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryChunks<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryChunks<S>>, item: Item, ) -> Result<(), <TryChunks<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryChunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryChunks<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryChunks<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryChunks<S> as Sink<Item>>::Error>>
Source§impl<S, Item> Sink<Item> for TryFlatten<S>
impl<S, Item> Sink<Item> for TryFlatten<S>
type Error = <S as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut TryFlatten<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFlatten<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryFlatten<S>>, item: Item, ) -> Result<(), <TryFlatten<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryFlatten<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFlatten<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryFlatten<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryFlatten<S> as Sink<Item>>::Error>>
Source§impl<S, Item, E> Sink<Item> for TryBufferUnordered<S>
impl<S, Item, E> Sink<Item> for TryBufferUnordered<S>
type Error = E
fn poll_ready( self: Pin<&mut TryBufferUnordered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryBufferUnordered<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryBufferUnordered<S>>, item: Item, ) -> Result<(), <TryBufferUnordered<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryBufferUnordered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryBufferUnordered<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryBufferUnordered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryBufferUnordered<S> as Sink<Item>>::Error>>
Source§impl<S, Item, E> Sink<Item> for TryBuffered<S>
impl<S, Item, E> Sink<Item> for TryBuffered<S>
type Error = E
fn poll_ready( self: Pin<&mut TryBuffered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryBuffered<S> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut TryBuffered<S>>, item: Item, ) -> Result<(), <TryBuffered<S> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut TryBuffered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryBuffered<S> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut TryBuffered<S>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <TryBuffered<S> as Sink<Item>>::Error>>
Source§impl<Si1, Si2, Item> Sink<Item> for Fanout<Si1, Si2>
impl<Si1, Si2, Item> Sink<Item> for Fanout<Si1, Si2>
type Error = <Si1 as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Fanout<Si1, Si2>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Fanout<Si1, Si2> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Fanout<Si1, Si2>>, item: Item, ) -> Result<(), <Fanout<Si1, Si2> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Fanout<Si1, Si2>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Fanout<Si1, Si2> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Fanout<Si1, Si2>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Fanout<Si1, Si2> as Sink<Item>>::Error>>
Source§impl<Si, F, E, Item> Sink<Item> for SinkMapErr<Si, F>
impl<Si, F, E, Item> Sink<Item> for SinkMapErr<Si, F>
type Error = E
fn poll_ready( self: Pin<&mut SinkMapErr<Si, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SinkMapErr<Si, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut SinkMapErr<Si, F>>, item: Item, ) -> Result<(), <SinkMapErr<Si, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut SinkMapErr<Si, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SinkMapErr<Si, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut SinkMapErr<Si, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SinkMapErr<Si, F> as Sink<Item>>::Error>>
Source§impl<Si, Item> Sink<Item> for Buffer<Si, Item>where
Si: Sink<Item>,
impl<Si, Item> Sink<Item> for Buffer<Si, Item>where
Si: Sink<Item>,
type Error = <Si as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Buffer<Si, Item>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Buffer<Si, Item> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Buffer<Si, Item>>, item: Item, ) -> Result<(), <Buffer<Si, Item> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Buffer<Si, Item>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Buffer<Si, Item> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Buffer<Si, Item>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Buffer<Si, Item> as Sink<Item>>::Error>>
Source§impl<Si, Item, E> Sink<Item> for SinkErrInto<Si, Item, E>
impl<Si, Item, E> Sink<Item> for SinkErrInto<Si, Item, E>
type Error = E
fn poll_ready( self: Pin<&mut SinkErrInto<Si, Item, E>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SinkErrInto<Si, Item, E> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut SinkErrInto<Si, Item, E>>, item: Item, ) -> Result<(), <SinkErrInto<Si, Item, E> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut SinkErrInto<Si, Item, E>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SinkErrInto<Si, Item, E> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut SinkErrInto<Si, Item, E>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <SinkErrInto<Si, Item, E> as Sink<Item>>::Error>>
Source§impl<Si, Item, U, Fut, F, E> Sink<U> for With<Si, Item, U, Fut, F>
impl<Si, Item, U, Fut, F, E> Sink<U> for With<Si, Item, U, Fut, F>
type Error = E
fn poll_ready( self: Pin<&mut With<Si, Item, U, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <With<Si, Item, U, Fut, F> as Sink<U>>::Error>>
fn start_send( self: Pin<&mut With<Si, Item, U, Fut, F>>, item: U, ) -> Result<(), <With<Si, Item, U, Fut, F> as Sink<U>>::Error>
fn poll_flush( self: Pin<&mut With<Si, Item, U, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <With<Si, Item, U, Fut, F> as Sink<U>>::Error>>
fn poll_close( self: Pin<&mut With<Si, Item, U, Fut, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <With<Si, Item, U, Fut, F> as Sink<U>>::Error>>
Source§impl<Si, Item, U, St, F> Sink<U> for WithFlatMap<Si, Item, U, St, F>
impl<Si, Item, U, St, F> Sink<U> for WithFlatMap<Si, Item, U, St, F>
type Error = <Si as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut WithFlatMap<Si, Item, U, St, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WithFlatMap<Si, Item, U, St, F> as Sink<U>>::Error>>
fn start_send( self: Pin<&mut WithFlatMap<Si, Item, U, St, F>>, item: U, ) -> Result<(), <WithFlatMap<Si, Item, U, St, F> as Sink<U>>::Error>
fn poll_flush( self: Pin<&mut WithFlatMap<Si, Item, U, St, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WithFlatMap<Si, Item, U, St, F> as Sink<U>>::Error>>
fn poll_close( self: Pin<&mut WithFlatMap<Si, Item, U, St, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WithFlatMap<Si, Item, U, St, F> as Sink<U>>::Error>>
Source§impl<St, F, Item> Sink<Item> for Map<St, F>
impl<St, F, Item> Sink<Item> for Map<St, F>
type Error = <St as Sink<Item>>::Error
fn poll_ready( self: Pin<&mut Map<St, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Map<St, F> as Sink<Item>>::Error>>
fn start_send( self: Pin<&mut Map<St, F>>, item: Item, ) -> Result<(), <Map<St, F> as Sink<Item>>::Error>
fn poll_flush( self: Pin<&mut Map<St, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Map<St, F> as Sink<Item>>::Error>>
fn poll_close( self: Pin<&mut Map<St, F>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Map<St, F> as Sink<Item>>::Error>>
Source§impl<T> Sink<Message> for WebSocketStream<T>
impl<T> Sink<Message> for WebSocketStream<T>
type Error = Error
fn poll_ready( self: Pin<&mut WebSocketStream<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WebSocketStream<T> as Sink<Message>>::Error>>
fn start_send( self: Pin<&mut WebSocketStream<T>>, item: Message, ) -> Result<(), <WebSocketStream<T> as Sink<Message>>::Error>
fn poll_flush( self: Pin<&mut WebSocketStream<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WebSocketStream<T> as Sink<Message>>::Error>>
fn poll_close( self: Pin<&mut WebSocketStream<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <WebSocketStream<T> as Sink<Message>>::Error>>
Source§impl<T> Sink<T> for &UnboundedSender<T>
impl<T> Sink<T> for &UnboundedSender<T>
type Error = SendError
fn poll_ready( self: Pin<&mut &UnboundedSender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <&UnboundedSender<T> as Sink<T>>::Error>>
fn start_send( self: Pin<&mut &UnboundedSender<T>>, msg: T, ) -> Result<(), <&UnboundedSender<T> as Sink<T>>::Error>
fn poll_flush( self: Pin<&mut &UnboundedSender<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <&UnboundedSender<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut &UnboundedSender<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <&UnboundedSender<T> as Sink<T>>::Error>>
Source§impl<T> Sink<T> for VecDeque<T>
impl<T> Sink<T> for VecDeque<T>
type Error = Infallible
fn poll_ready( self: Pin<&mut VecDeque<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <VecDeque<T> as Sink<T>>::Error>>
fn start_send( self: Pin<&mut VecDeque<T>>, item: T, ) -> Result<(), <VecDeque<T> as Sink<T>>::Error>
fn poll_flush( self: Pin<&mut VecDeque<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <VecDeque<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut VecDeque<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <VecDeque<T> as Sink<T>>::Error>>
Source§impl<T> Sink<T> for Vec<T>
impl<T> Sink<T> for Vec<T>
type Error = Infallible
fn poll_ready( self: Pin<&mut Vec<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>
fn start_send( self: Pin<&mut Vec<T>>, item: T, ) -> Result<(), <Vec<T> as Sink<T>>::Error>
fn poll_flush( self: Pin<&mut Vec<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut Vec<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>
Source§impl<T> Sink<T> for Sender<T>
impl<T> Sink<T> for Sender<T>
type Error = SendError
fn poll_ready( self: Pin<&mut Sender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Sender<T> as Sink<T>>::Error>>
fn start_send( self: Pin<&mut Sender<T>>, msg: T, ) -> Result<(), <Sender<T> as Sink<T>>::Error>
fn poll_flush( self: Pin<&mut Sender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <Sender<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut Sender<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <Sender<T> as Sink<T>>::Error>>
Source§impl<T> Sink<T> for UnboundedSender<T>
impl<T> Sink<T> for UnboundedSender<T>
type Error = SendError
fn poll_ready( self: Pin<&mut UnboundedSender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <UnboundedSender<T> as Sink<T>>::Error>>
fn start_send( self: Pin<&mut UnboundedSender<T>>, msg: T, ) -> Result<(), <UnboundedSender<T> as Sink<T>>::Error>
fn poll_flush( self: Pin<&mut UnboundedSender<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <UnboundedSender<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut UnboundedSender<T>>, _: &mut Context<'_>, ) -> Poll<Result<(), <UnboundedSender<T> as Sink<T>>::Error>>
Source§impl<T> Sink<T> for Drain<T>
impl<T> Sink<T> for Drain<T>
type Error = Infallible
fn poll_ready( self: Pin<&mut Drain<T>>, _cx: &mut Context<'_>, ) -> Poll<Result<(), <Drain<T> as Sink<T>>::Error>>
fn start_send( self: Pin<&mut Drain<T>>, _item: T, ) -> Result<(), <Drain<T> as Sink<T>>::Error>
fn poll_flush( self: Pin<&mut Drain<T>>, _cx: &mut Context<'_>, ) -> Poll<Result<(), <Drain<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut Drain<T>>, _cx: &mut Context<'_>, ) -> Poll<Result<(), <Drain<T> as Sink<T>>::Error>>
Source§impl<T> Sink<T> for PollSender<T>where
T: Send + 'static,
impl<T> Sink<T> for PollSender<T>where
T: Send + 'static,
Source§fn poll_ready(
self: Pin<&mut PollSender<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), <PollSender<T> as Sink<T>>::Error>>
fn poll_ready( self: Pin<&mut PollSender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <PollSender<T> as Sink<T>>::Error>>
This is equivalent to calling poll_send_done.
Source§fn poll_flush(
self: Pin<&mut PollSender<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), <PollSender<T> as Sink<T>>::Error>>
fn poll_flush( self: Pin<&mut PollSender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <PollSender<T> as Sink<T>>::Error>>
This is equivalent to calling poll_send_done.
Source§fn start_send(
self: Pin<&mut PollSender<T>>,
item: T,
) -> Result<(), <PollSender<T> as Sink<T>>::Error>
fn start_send( self: Pin<&mut PollSender<T>>, item: T, ) -> Result<(), <PollSender<T> as Sink<T>>::Error>
This is equivalent to calling start_send.
Source§fn poll_close(
self: Pin<&mut PollSender<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), <PollSender<T> as Sink<T>>::Error>>
fn poll_close( self: Pin<&mut PollSender<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), <PollSender<T> as Sink<T>>::Error>>
This method will first flush the PollSender, and then close it by
calling close_this_sender.
If a send fails while flushing because the Receiver has gone away,
then this function returns an error. The channel is still successfully
closed in this situation.