fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), SendError>> {
        let state = decode_state(self.inner.state.load(SeqCst));
        if !state.is_open {
            return Poll::Ready(Err(SendError { kind: SendErrorKind::Disconnected }));
        }

        self.poll_unparked(Some(cx)).map(Ok)
    }
Polls the channel to determine if there is guaranteed capacity to send
at least one item without waiting.

# Return value

This method returns:

- `Poll::Ready(Ok(_))` if there is sufficient capacity;
- `Poll::Pending` if the channel may not have
capacity, in which case the current task is queued to be notified once
capacity is available;
- `Poll::Ready(Err(SendError))` if the receiver has been dropped.
futures-channel/src/mpsc/mod.rs