async fn handle_one_request(
        holder: Arc<Mutex<AnnotationHolder>>,
        watch_subscriber: &mut WatchSubscriber,
        stream: &mut felement::AnnotationControllerRequestStream,
    ) -> Result<(), AnnotationError> {
        if let Some(request) = stream.try_next().await.unwrap() {
            let result = handle_annotation_controller_request(
                &mut holder.lock().unwrap(),
                watch_subscriber,
                request,
            );
            if result.is_err() {
                stream.control_handle().shutdown_with_epitaph(zx::Status::BAD_STATE);
            }
            return result;
        }
        Ok(())
    }
// A helper so that the stream and request result can be tested by the caller.
A helper so that the stream and request result can be tested by the caller.
A helper so that the stream and request result can be tested by the caller .
async fn handle_one_request(
        holder: Arc<Mutex<AnnotationHolder>>,
        watch_subscriber: &mut WatchSubscriber,
        stream: &mut felement::AnnotationControllerRequestStream,
    ) -> Result<(), AnnotationError> {
        if let Some(request) = stream.try_next().await.unwrap() {
            let result = handle_annotation_controller_request(
                &mut holder.lock().unwrap(),
                watch_subscriber,
                request,
            );
            if result.is_err() {
                stream.control_handle().shutdown_with_epitaph(zx::Status::BAD_STATE);
            }
            return result;
        }
        Ok(())
    }
async fn handle_one_request ( holder : Arc < Mutex < AnnotationHolder > > , watch_subscriber : & mut WatchSubscriber , stream : & mut felement :: AnnotationControllerRequestStream , ) -> Result < ( ) , AnnotationError > { if let Some ( request ) = stream . try_next ( ) . await . unwrap ( ) { let result = handle_annotation_controller_request ( & mut holder . lock ( ) . unwrap ( ) , watch_subscriber , request , ) ; if result . is_err ( ) { stream . control_handle ( ) . shutdown_with_epitaph ( zx :: Status :: BAD_STATE ) ; } return result ; } Ok ( ( ) ) }
A helper so that the stream and request result can be tested by the caller.
A helper so that the stream and request result can be tested by the caller .
holder
Arc<Mutex<AnnotationHolder>>
watch_subscriber
&mut WatchSubscriber
stream
&mut felement::AnnotationControllerRequestStream
holder
Arc<Mutex<AnnotationHolder>>
watch_subscriber
&mut WatchSubscriber
stream
&mut felement::AnnotationControllerRequestStream