async fn handle_client_request_scan(
    iterator: fidl::endpoints::ServerEnd<fidl_policy::ScanResultIteratorMarker>,
) -> Result<(), fidl::Error> {
    // for now instead of getting scan results, just return a general error
    // TODO(44878) implement this method: perform a scan and return the results (networks or error)
    let scan_results = Err(fidl_policy::ScanErrorCode::GeneralError);

    // wait to get a request for a chunk of scan results, so we can respond to it with an error
    let mut stream = iterator.into_stream()?;

    if let Some(req) = stream.try_next().await? {
        let fidl_policy::ScanResultIteratorRequest::GetNext { responder } = req;
        let mut next_result = scan_results;
        responder.send(&mut next_result)?;
    } else {
        // This will happen if the iterator request stream was closed and we expected to send
        // another response.
        // TODO(45113) Test this error path
        info!("Info: peer closed channel for scan results unexpectedly");
    }
    Ok(())
}
/// Respond to a scan request, returning results through the given iterator.
/// This function is not yet implemented and just sends back that there was an error.
Respond to a scan request, returning results through the given iterator.
This function is not yet implemented and just sends back that there was an error.
Respond to a scan request returning results through the given iterator . This function is not yet implemented and just sends back that there was an error .
async fn handle_client_request_scan(
    iterator: fidl::endpoints::ServerEnd<fidl_policy::ScanResultIteratorMarker>,
) -> Result<(), fidl::Error> {
    // for now instead of getting scan results, just return a general error
    // TODO(44878) implement this method: perform a scan and return the results (networks or error)
    let scan_results = Err(fidl_policy::ScanErrorCode::GeneralError);
    // wait to get a request for a chunk of scan results, so we can respond to it with an error
    let mut stream = iterator.into_stream()?;
    if let Some(req) = stream.try_next().await? {
        let fidl_policy::ScanResultIteratorRequest::GetNext { responder } = req;
        let mut next_result = scan_results;
        responder.send(&mut next_result)?;
    } else {
        // This will happen if the iterator request stream was closed and we expected to send
        // another response.
        // TODO(45113) Test this error path
        info!("Info: peer closed channel for scan results unexpectedly");
    }
    Ok(())
}
async fn handle_client_request_scan ( iterator : fidl :: endpoints :: ServerEnd < fidl_policy :: ScanResultIteratorMarker > , ) -> Result < ( ) , fidl :: Error > { // for now instead of getting scan results, just return a general error // TODO(44878) implement this method: perform a scan and return the results (networks or error) let scan_results = Err ( fidl_policy :: ScanErrorCode :: GeneralError ) ; // wait to get a request for a chunk of scan results, so we can respond to it with an error let mut stream = iterator . into_stream ( ) ? ; if let Some ( req ) = stream . try_next ( ) . await ? { let fidl_policy :: ScanResultIteratorRequest :: GetNext { responder } = req ; let mut next_result = scan_results ; responder . send ( & mut next_result ) ? ; } else { // This will happen if the iterator request stream was closed and we expected to send // another response. // TODO(45113) Test this error path info ! ( " " ) ; } Ok ( ( ) ) }
Respond to a scan request, returning results through the given iterator.
Respond to a scan request returning results through the given iterator .
iterator
fidl::endpoints::ServerEnd<fidl_policy::ScanResultIteratorMarker>
iterator
fidl::endpoints::ServerEnd<fidl_policy::ScanResultIteratorMarker>