fn poll_next_data_update(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Option<<Self as Stream>::Item>> {
        if let Some(slc_req) = self.unprocessed_slc_requests.pop_front() {
            return Poll::Ready(Some(Ok(slc_req)));
        }
        // Otherwise loop until we have received all bytes and sent all responses.
        loop {
            if let Some(conn) = &mut self.connection {
                match conn.poll_next_unpin(cx) {
                    Poll::Ready(Some(Ok(mut data))) => {
                        self.receive_data(&mut data);
                        let request = self.unprocessed_slc_requests.pop_front();
                        // If the SLC requires more information, bubble it up.
                        // Otherwise, try to send any queued data as a result of self.receive_data()
                        // and continue the loop to register a waker for the next read.
                        match request {
                            Some(slc_req) => return Poll::Ready(Some(Ok(slc_req))),
                            None => {
                                if let Some(conn) = &mut self.connection {
                                    if let Err(e) = conn.try_send_queued(cx) {
                                        return Poll::Ready(Some(Err(e.into())));
                                    }
                                }
                                continue;
                            }
                        }
                    }
                    Poll::Ready(Some(Err(e))) => return Poll::Ready(Some(Err(e.into()))),
                    Poll::Ready(None) => {
                        self.reset();
                        return Poll::Ready(None);
                    }
                    Poll::Pending => break,
                }
            } else {
                break;
            }
        }
        Poll::Pending
    }
/// Helper function to poll the RFCOMM channel for messages from the remote peer.
Helper function to poll the RFCOMM channel for messages from the remote peer.
Helper function to poll the RFCOMM channel for messages from the remote peer .
fn poll_next_data_update(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Option<<Self as Stream>::Item>> {
        if let Some(slc_req) = self.unprocessed_slc_requests.pop_front() {
            return Poll::Ready(Some(Ok(slc_req)));
        }
        // Otherwise loop until we have received all bytes and sent all responses.
        loop {
            if let Some(conn) = &mut self.connection {
                match conn.poll_next_unpin(cx) {
                    Poll::Ready(Some(Ok(mut data))) => {
                        self.receive_data(&mut data);
                        let request = self.unprocessed_slc_requests.pop_front();
                        // If the SLC requires more information, bubble it up.
                        // Otherwise, try to send any queued data as a result of self.receive_data()
                        // and continue the loop to register a waker for the next read.
                        match request {
                            Some(slc_req) => return Poll::Ready(Some(Ok(slc_req))),
                            None => {
                                if let Some(conn) = &mut self.connection {
                                    if let Err(e) = conn.try_send_queued(cx) {
                                        return Poll::Ready(Some(Err(e.into())));
                                    }
                                }
                                continue;
                            }
                        }
                    }
                    Poll::Ready(Some(Err(e))) => return Poll::Ready(Some(Err(e.into()))),
                    Poll::Ready(None) => {
                        self.reset();
                        return Poll::Ready(None);
                    }
                    Poll::Pending => break,
                }
            } else {
                break;
            }
        }
        Poll::Pending
    }
fn poll_next_data_update ( & mut self , cx : & mut Context < ' _ > , ) -> Poll < Option < < Self as Stream > :: Item > > { if let Some ( slc_req ) = self . unprocessed_slc_requests . pop_front ( ) { return Poll :: Ready ( Some ( Ok ( slc_req ) ) ) ; } // Otherwise loop until we have received all bytes and sent all responses. loop { if let Some ( conn ) = & mut self . connection { match conn . poll_next_unpin ( cx ) { Poll :: Ready ( Some ( Ok ( mut data ) ) ) => { self . receive_data ( & mut data ) ; let request = self . unprocessed_slc_requests . pop_front ( ) ; // If the SLC requires more information, bubble it up. // Otherwise, try to send any queued data as a result of self.receive_data() // and continue the loop to register a waker for the next read. match request { Some ( slc_req ) => return Poll :: Ready ( Some ( Ok ( slc_req ) ) ) , None => { if let Some ( conn ) = & mut self . connection { if let Err ( e ) = conn . try_send_queued ( cx ) { return Poll :: Ready ( Some ( Err ( e . into ( ) ) ) ) ; } } continue ; } } } Poll :: Ready ( Some ( Err ( e ) ) ) => return Poll :: Ready ( Some ( Err ( e . into ( ) ) ) ) , Poll :: Ready ( None ) => { self . reset ( ) ; return Poll :: Ready ( None ) ; } Poll :: Pending => break , } } else { break ; } } Poll :: Pending }
Helper function to poll the RFCOMM channel for messages from the remote peer.
Helper function to poll the RFCOMM channel for messages from the remote peer .
&mut self
cx
&mut Context<'_>
&mut self
cx
&mut Context<'_>