pub async fn expect_observer_connection_request(
        &mut self,
        other: bt_types::PeerId,
    ) -> Result<(), Error> {
        let request = self.expect_observer_request().await?;
        match request {
            bredr::PeerObserverRequest::PeerConnected { peer_id, responder, .. } => {
                responder.send().unwrap();
                if other == peer_id.into() {
                    Ok(())
                } else {
                    Err(format_err!("Connection request for unexpected peer: {:?}", peer_id))
                }
            }
            x => Err(format_err!("Expected PeerConnected but got: {:?}", x)),
        }
    }
/// Expects a connection request between the profile under test and the `other` peer.
///
/// Returns Ok on success, Error if there was no connection request on the observer or
/// the request was for a different peer.
Expects a connection request between the profile under test and the `other` peer.
Returns Ok on success, Error if there was no connection request on the observer or
the request was for a different peer.
Expects a connection request between the profile under test and the ` other ` peer . Returns Ok on success Error if there was no connection request on the observer or the request was for a different peer .
pub async fn expect_observer_connection_request(
        &mut self,
        other: bt_types::PeerId,
    ) -> Result<(), Error> {
        let request = self.expect_observer_request().await?;
        match request {
            bredr::PeerObserverRequest::PeerConnected { peer_id, responder, .. } => {
                responder.send().unwrap();
                if other == peer_id.into() {
                    Ok(())
                } else {
                    Err(format_err!("Connection request for unexpected peer: {:?}", peer_id))
                }
            }
            x => Err(format_err!("Expected PeerConnected but got: {:?}", x)),
        }
    }
pub async fn expect_observer_connection_request ( & mut self , other : bt_types :: PeerId , ) -> Result < ( ) , Error > { let request = self . expect_observer_request ( ) . await ? ; match request { bredr :: PeerObserverRequest :: PeerConnected { peer_id , responder , .. } => { responder . send ( ) . unwrap ( ) ; if other == peer_id . into ( ) { Ok ( ( ) ) } else { Err ( format_err ! ( " " peer_id ) ) } } x => Err ( format_err ! ( " " x ) ) , } }
Expects a connection request between the profile under test and the `other` peer.
Expects a connection request between the profile under test and the ` other ` peer .
&mut self
other
bt_types::PeerId
&mut self
other
bt_types::PeerId