// Returns a Future that handles Host interface events.
Returns a Future that handles Host interface events.
Returns a Future that handles Host interface events .
fn events_future(test_state: HostDriverHarness) -> impl Future<Output = Result<(), Error>> {
        let stream = test_state.0.read().host_proxy.take_event_stream();
        stream
            .try_for_each(move |evt| {
                match evt {
                    HostEvent::OnAdapterStateChanged { state } => {
                        test_state.0.write().handle_driver_state_changed(state);
                    }
                    HostEvent::OnDeviceUpdated { device } => {
                        test_state.0.write().handle_device_updated(device);
                    }
                    HostEvent::OnDeviceRemoved { identifier } => {
                        test_state.0.write().handle_device_removed(identifier);
                    }
                    // TODO(armansito): handle other events
                    evt => {
                        eprintln!("Unhandled event: {:?}", evt);
                    }
                }
                future::ready(Ok(()))
            })
            .err_into()
    }
fn events_future ( test_state : HostDriverHarness ) -> impl Future < Output = Result < ( ) , Error > > { let stream = test_state . 0 . read ( ) . host_proxy . take_event_stream ( ) ; stream . try_for_each ( move | evt | { match evt { HostEvent :: OnAdapterStateChanged { state } => { test_state . 0 . write ( ) . handle_driver_state_changed ( state ) ; } HostEvent :: OnDeviceUpdated { device } => { test_state . 0 . write ( ) . handle_device_updated ( device ) ; } HostEvent :: OnDeviceRemoved { identifier } => { test_state . 0 . write ( ) . handle_device_removed ( identifier ) ; } // TODO(armansito): handle other events evt => { eprintln ! ( " " evt ) ; } } future :: ready ( Ok ( ( ) ) ) } ) . err_into ( ) }
Returns a Future that handles Host interface events.
Returns a Future that handles Host interface events .
test_state
HostDriverHarness