// [START handler]
// Handler for incoming service requests
[START handler]
Handler for incoming service requests
[ START handler ] Handler for incoming service requests
async fn handle_echo_request(mut stream: EchoRequestStream) {
    while let Some(event) = stream.try_next().await.expect("failed to serve echo service") {
        let EchoRequest::EchoString { value, responder } = event;
        responder.send(value.as_ref().map(|s| &**s)).expect("failed to send echo response");
    }
}
async fn handle_echo_request ( mut stream : EchoRequestStream ) { while let Some ( event ) = stream . try_next ( ) . await . expect ( " " ) { let EchoRequest :: EchoString { value , responder } = event ; responder . send ( value . as_ref ( ) . map ( | s | & * * s ) ) . expect ( " " ) ; } }
[START handler]
Handler for incoming service requests
[ START handler ] Handler for incoming service requests
stream
EchoRequestStream