fn maybe_serve_handler_async(event: Event) -> Option<ClientEnd<fsys::HandlerMarker>> {
    if event.sync_mode() == SyncMode::Async {
        return None;
    }
    let (client_end, mut stream) = create_request_stream::<fsys::HandlerMarker>()
        .expect("could not create request stream for handler protocol");
    fasync::spawn(async move {
        // Expect exactly one call to Resume
        if let Some(Ok(fsys::HandlerRequest::Resume { responder })) = stream.next().await {
            event.resume();
            responder.send().unwrap();
        }
    });
    Some(client_end)
}
/// Serves the server end of Handler FIDL protocol asynchronously
Serves the server end of Handler FIDL protocol asynchronously
Serves the server end of Handler FIDL protocol asynchronously
fn maybe_serve_handler_async(event: Event) -> Option<ClientEnd<fsys::HandlerMarker>> {
    if event.sync_mode() == SyncMode::Async {
        return None;
    }
    let (client_end, mut stream) = create_request_stream::<fsys::HandlerMarker>()
        .expect("could not create request stream for handler protocol");
    fasync::spawn(async move {
        // Expect exactly one call to Resume
        if let Some(Ok(fsys::HandlerRequest::Resume { responder })) = stream.next().await {
            event.resume();
            responder.send().unwrap();
        }
    });
    Some(client_end)
}
fn maybe_serve_handler_async ( event : Event ) -> Option < ClientEnd < fsys :: HandlerMarker > > { if event . sync_mode ( ) == SyncMode :: Async { return None ; } let ( client_end , mut stream ) = create_request_stream :: < fsys :: HandlerMarker > ( ) . expect ( " " ) ; fasync :: spawn ( async move { // Expect exactly one call to Resume if let Some ( Ok ( fsys :: HandlerRequest :: Resume { responder } ) ) = stream . next ( ) . await { event . resume ( ) ; responder . send ( ) . unwrap ( ) ; } } ) ; Some ( client_end ) }
Serves the server end of Handler FIDL protocol asynchronously
Serves the server end of Handler FIDL protocol asynchronously
event
Event
event
Event