pub fn poll_ready(&mut self, cx: &mut Context) -> Poll<bool> {
        if let State::Open {
            substream,
            close_waker,
            ..
        } = &mut self.state
        {
            match substream.poll_ready_unpin(cx) {
                Poll::Ready(Ok(())) => Poll::Ready(true),
                Poll::Ready(Err(_)) => Poll::Ready(false),
                Poll::Pending => {
                    *close_waker = Some(cx.waker().clone());
                    Poll::Pending
                }
            }
        } else {
            Poll::Ready(false)
        }
    }
/// Polls whether the outbound substream is ready to send a notification.
///
/// - Returns `Poll::Pending` if the substream is open but not ready to send a notification.
/// - Returns `Poll::Ready(true)` if the substream is ready to send a notification.
/// - Returns `Poll::Ready(false)` if the substream is closed.
///
Polls whether the outbound substream is ready to send a notification.
Returns `Poll::Pending` if the substream is open but not ready to send a notification.
Returns `Poll::Ready(true)` if the substream is ready to send a notification.
Returns `Poll::Ready(false)` if the substream is closed.
Polls whether the outbound substream is ready to send a notification . Returns ` Poll :: Pending ` if the substream is open but not ready to send a notification . Returns ` Poll :: Ready ( true ) ` if the substream is ready to send a notification . Returns ` Poll :: Ready ( false ) ` if the substream is closed .
pub fn poll_ready(&mut self, cx: &mut Context) -> Poll<bool> {
        if let State::Open {
            substream,
            close_waker,
            ..
        } = &mut self.state
        {
            match substream.poll_ready_unpin(cx) {
                Poll::Ready(Ok(())) => Poll::Ready(true),
                Poll::Ready(Err(_)) => Poll::Ready(false),
                Poll::Pending => {
                    *close_waker = Some(cx.waker().clone());
                    Poll::Pending
                }
            }
        } else {
            Poll::Ready(false)
        }
    }
pub fn poll_ready ( & mut self , cx : & mut Context ) -> Poll < bool > { if let State :: Open { substream , close_waker , .. } = & mut self . state { match substream . poll_ready_unpin ( cx ) { Poll :: Ready ( Ok ( ( ) ) ) => Poll :: Ready ( true ) , Poll :: Ready ( Err ( _ ) ) => Poll :: Ready ( false ) , Poll :: Pending => { * close_waker = Some ( cx . waker ( ) . clone ( ) ) ; Poll :: Pending } } } else { Poll :: Ready ( false ) } }
Polls whether the outbound substream is ready to send a notification.
Polls whether the outbound substream is ready to send a notification .
&mut self
cx
&mut Context
&mut self
cx
&mut Context