pub async fn connect_to_camera(
    service_context_handle: Arc<ServiceContext>,
) -> Result<Camera3DeviceProxy, Error> {
    // Connect to the camera device watcher to get camera ids. This will
    // be used to connect to the camera.
    let camera_watcher_proxy = connect_to_camera_watcher(service_context_handle).await?;
    let camera_id = get_camera_id(&camera_watcher_proxy).await?;

    // Connect to the camera device with the found id.
    let (camera_proxy, device_server) = create_proxy::<DeviceMarker>().unwrap();
    if call!(camera_watcher_proxy => connect_to_device(camera_id, device_server)).is_err() {
        return Err(format_err!("Could not connect to fuchsia.camera3.DeviceWatcher device"));
    }
    Ok(camera_proxy)
}
/// Establishes a connection to the fuchsia.camera3.Device api by watching
/// the camera id and using it to connect to the device.
Establishes a connection to the fuchsia.camera3.Device api by watching
the camera id and using it to connect to the device.
Establishes a connection to the fuchsia . camera3 . Device api by watching the camera id and using it to connect to the device .
pub async fn connect_to_camera(
    service_context_handle: Arc<ServiceContext>,
) -> Result<Camera3DeviceProxy, Error> {
    // Connect to the camera device watcher to get camera ids. This will
    // be used to connect to the camera.
    let camera_watcher_proxy = connect_to_camera_watcher(service_context_handle).await?;
    let camera_id = get_camera_id(&camera_watcher_proxy).await?;
    // Connect to the camera device with the found id.
    let (camera_proxy, device_server) = create_proxy::<DeviceMarker>().unwrap();
    if call!(camera_watcher_proxy => connect_to_device(camera_id, device_server)).is_err() {
        return Err(format_err!("Could not connect to fuchsia.camera3.DeviceWatcher device"));
    }
    Ok(camera_proxy)
}
pub async fn connect_to_camera ( service_context_handle : Arc < ServiceContext > , ) -> Result < Camera3DeviceProxy , Error > { // Connect to the camera device watcher to get camera ids. This will // be used to connect to the camera. let camera_watcher_proxy = connect_to_camera_watcher ( service_context_handle ) . await ? ; let camera_id = get_camera_id ( & camera_watcher_proxy ) . await ? ; // Connect to the camera device with the found id. let ( camera_proxy , device_server ) = create_proxy :: < DeviceMarker > ( ) . unwrap ( ) ; if call ! ( camera_watcher_proxy connect_to_device ( camera_id device_server ) ) . is_err ( ) { return Err ( format_err ! ( " " ) ) ; } Ok ( camera_proxy ) }
Establishes a connection to the fuchsia.camera3.Device api by watching
the camera id and using it to connect to the device.
Establishes a connection to the fuchsia . camera3 . Device api by watching the camera id and using it to connect to the device .
service_context_handle
Arc<ServiceContext>
service_context_handle
Arc<ServiceContext>