fn make_token(
        responder: di::DeviceIdentificationSetDeviceIdentificationResponder,
        request_server: di::DeviceIdentificationHandleRequestStream,
        done: bool,
    ) -> (DeviceIdRequestToken, ConnectionReceiverProxy, fasync::Task<()>) {
        let (adv_fut, junk_task) = if done {
            (QueryResponseFut(MaybeDone::Done(Ok(Ok(())))), fasync::Task::local(async {}))
        } else {
            // Otherwise, we need a future that will not resolve yet.
            let (c, _s) = fidl::endpoints::create_proxy_and_stream::<ProfileMarker>().unwrap();
            let (c2, _s2) =
                fidl::endpoints::create_request_stream::<ConnectionReceiverMarker>().unwrap();
            let fut = c.advertise(&mut vec![].into_iter(), ChannelParameters::EMPTY, c2);
            let task = fasync::Task::local(async {
                let (_s, _s2, _c) = (_s, _s2, c); // Keep everything alive.
                futures::future::pending::<()>().await;
            });
            (fut, task)
        };
        // Use a random service definition.
        let svc = DeviceIdentificationService::from_di_records(&vec![minimal_record(false)])
            .expect("should parse record");
        // A BR/EDR advertise request.
        let (connect_client, connect_server) =
            fidl::endpoints::create_proxy_and_stream::<ConnectionReceiverMarker>().unwrap();
        let advertisement = BrEdrAdvertisement { adv_fut, connect_server };
        let token = DeviceIdRequestToken::new(svc, advertisement, request_server, responder);

        (token, connect_client, junk_task)
    }
/// Makes a DeviceIdRequestToken from the provided `responder`. If `done` is true, then the
/// upstream advertisement emulated by this function will immediately resolve.
/// Returns the token, the proxy associated with the upstream advertisement, and a "junk" task
/// that should be kept alive for the duration of the test.
Makes a DeviceIdRequestToken from the provided `responder`. If `done` is true, then the
upstream advertisement emulated by this function will immediately resolve.
Returns the token, the proxy associated with the upstream advertisement, and a "junk" task
that should be kept alive for the duration of the test.
Makes a DeviceIdRequestToken from the provided ` responder ` . If ` done ` is true then the upstream advertisement emulated by this function will immediately resolve . Returns the token the proxy associated with the upstream advertisement and a " junk " task that should be kept alive for the duration of the test .
fn make_token(
        responder: di::DeviceIdentificationSetDeviceIdentificationResponder,
        request_server: di::DeviceIdentificationHandleRequestStream,
        done: bool,
    ) -> (DeviceIdRequestToken, ConnectionReceiverProxy, fasync::Task<()>) {
        let (adv_fut, junk_task) = if done {
            (QueryResponseFut(MaybeDone::Done(Ok(Ok(())))), fasync::Task::local(async {}))
        } else {
            // Otherwise, we need a future that will not resolve yet.
            let (c, _s) = fidl::endpoints::create_proxy_and_stream::<ProfileMarker>().unwrap();
            let (c2, _s2) =
                fidl::endpoints::create_request_stream::<ConnectionReceiverMarker>().unwrap();
            let fut = c.advertise(&mut vec![].into_iter(), ChannelParameters::EMPTY, c2);
            let task = fasync::Task::local(async {
                let (_s, _s2, _c) = (_s, _s2, c); // Keep everything alive.
                futures::future::pending::<()>().await;
            });
            (fut, task)
        };
        // Use a random service definition.
        let svc = DeviceIdentificationService::from_di_records(&vec![minimal_record(false)])
            .expect("should parse record");
        // A BR/EDR advertise request.
        let (connect_client, connect_server) =
            fidl::endpoints::create_proxy_and_stream::<ConnectionReceiverMarker>().unwrap();
        let advertisement = BrEdrAdvertisement { adv_fut, connect_server };
        let token = DeviceIdRequestToken::new(svc, advertisement, request_server, responder);
        (token, connect_client, junk_task)
    }
fn make_token ( responder : di :: DeviceIdentificationSetDeviceIdentificationResponder , request_server : di :: DeviceIdentificationHandleRequestStream , done : bool , ) -> ( DeviceIdRequestToken , ConnectionReceiverProxy , fasync :: Task < ( ) > ) { let ( adv_fut , junk_task ) = if done { ( QueryResponseFut ( MaybeDone :: Done ( Ok ( Ok ( ( ) ) ) ) ) , fasync :: Task :: local ( async { } ) ) } else { // Otherwise, we need a future that will not resolve yet. let ( c , _s ) = fidl :: endpoints :: create_proxy_and_stream :: < ProfileMarker > ( ) . unwrap ( ) ; let ( c2 , _s2 ) = fidl :: endpoints :: create_request_stream :: < ConnectionReceiverMarker > ( ) . unwrap ( ) ; let fut = c . advertise ( & mut vec ! [ ] . into_iter ( ) , ChannelParameters :: EMPTY , c2 ) ; let task = fasync :: Task :: local ( async { let ( _s , _s2 , _c ) = ( _s , _s2 , c ) ; // Keep everything alive. futures :: future :: pending :: < ( ) > ( ) . await ; } ) ; ( fut , task ) } ; // Use a random service definition. let svc = DeviceIdentificationService :: from_di_records ( & vec ! [ minimal_record ( false ) ] ) . expect ( " " ) ; // A BR/EDR advertise request. let ( connect_client , connect_server ) = fidl :: endpoints :: create_proxy_and_stream :: < ConnectionReceiverMarker > ( ) . unwrap ( ) ; let advertisement = BrEdrAdvertisement { adv_fut , connect_server } ; let token = DeviceIdRequestToken :: new ( svc , advertisement , request_server , responder ) ; ( token , connect_client , junk_task ) }
Makes a DeviceIdRequestToken from the provided `responder`.
Makes a DeviceIdRequestToken from the provided ` responder ` .
responder
di::DeviceIdentificationSetDeviceIdentificationResponder
request_server
di::DeviceIdentificationHandleRequestStream
done
bool
responder
di::DeviceIdentificationSetDeviceIdentificationResponder
request_server
di::DeviceIdentificationHandleRequestStream
done
bool