fn expect_search_service_found(
        exec: &mut fasync::TestExecutor,
        stream: &mut bredr::SearchResultsRequestStream,
        other_peer: PeerId,
    ) -> Option<Vec<ProtocolDescriptor>> {
        let service_found_fut = stream.select_next_some();
        pin_mut!(service_found_fut);

        match exec.run_until_stalled(&mut service_found_fut) {
            Poll::Ready(Ok(bredr::SearchResultsRequest::ServiceFound {
                peer_id,
                protocol,
                responder,
                ..
            })) => {
                let _ = responder.send();
                assert_eq!(other_peer, peer_id.into());
                protocol.map(|p| p.iter().map(Into::into).collect())
            }
            x => panic!("Expected ServiceFound request but got: {:?}", x),
        }
    }
/// Expects a ServiceFound call to the `stream` for the `other_peer`. Returns the primary
/// protocol associated with the service.
///
/// Panics if the call doesn't happen.
Expects a ServiceFound call to the `stream` for the `other_peer`. Returns the primary
protocol associated with the service.

Panics if the call doesn't happen.
Expects a ServiceFound call to the ` stream ` for the ` other_peer ` . Returns the primary protocol associated with the service . Panics if the call doesn ' t happen .
fn expect_search_service_found(
        exec: &mut fasync::TestExecutor,
        stream: &mut bredr::SearchResultsRequestStream,
        other_peer: PeerId,
    ) -> Option<Vec<ProtocolDescriptor>> {
        let service_found_fut = stream.select_next_some();
        pin_mut!(service_found_fut);
        match exec.run_until_stalled(&mut service_found_fut) {
            Poll::Ready(Ok(bredr::SearchResultsRequest::ServiceFound {
                peer_id,
                protocol,
                responder,
                ..
            })) => {
                let _ = responder.send();
                assert_eq!(other_peer, peer_id.into());
                protocol.map(|p| p.iter().map(Into::into).collect())
            }
            x => panic!("Expected ServiceFound request but got: {:?}", x),
        }
    }
fn expect_search_service_found ( exec : & mut fasync :: TestExecutor , stream : & mut bredr :: SearchResultsRequestStream , other_peer : PeerId , ) -> Option < Vec < ProtocolDescriptor > > { let service_found_fut = stream . select_next_some ( ) ; pin_mut ! ( service_found_fut ) ; match exec . run_until_stalled ( & mut service_found_fut ) { Poll :: Ready ( Ok ( bredr :: SearchResultsRequest :: ServiceFound { peer_id , protocol , responder , .. } ) ) => { let _ = responder . send ( ) ; assert_eq ! ( other_peer peer_id into ( ) ) ; protocol . map ( | p | p . iter ( ) . map ( Into :: into ) . collect ( ) ) } x => panic ! ( " " x ) , } }
Expects a ServiceFound call to the `stream` for the `other_peer`.
Expects a ServiceFound call to the ` stream ` for the ` other_peer ` .
exec
&mut fasync::TestExecutor
stream
&mut bredr::SearchResultsRequestStream
other_peer
PeerId
exec
&mut fasync::TestExecutor
stream
&mut bredr::SearchResultsRequestStream
other_peer
PeerId