async fn request(child: &ChildRef, body: String) -> std::io::Result<String> {
    let answer = child
        .ask_anonymously(body)
        .expect("couldn't perform request");
    Ok(msg! { answer.await.expect("couldn't receive answer"),
        reply: String => {
            reply
        };
        unknown:_ => {
            error!("uh oh, I received a message I didn't understand: {:?}", unknown);
            "".to_string()
        };
    })
}
// This little helper allows me to send a request, and get a reply.
// The types are `String` for this quick example, but there's a way for us to do better.
// We will see this in other examples.
This little helper allows me to send a request, and get a reply.
The types are `String` for this quick example, but there's a way for us to do better.
We will see this in other examples.
This little helper allows me to send a request and get a reply . The types are ` String ` for this quick example but there ' s a way for us to do better . We will see this in other examples .
async fn request(child: &ChildRef, body: String) -> std::io::Result<String> {
    let answer = child
        .ask_anonymously(body)
        .expect("couldn't perform request");
    Ok(msg! { answer.await.expect("couldn't receive answer"),
        reply: String => {
            reply
        };
        unknown:_ => {
            error!("uh oh, I received a message I didn't understand: {:?}", unknown);
            "".to_string()
        };
    })
}
async fn request ( child : & ChildRef , body : String ) -> std :: io :: Result < String > { let answer = child . ask_anonymously ( body ) . expect ( " " ) ; Ok ( msg ! { answer await expect ( " " ) reply String { reply } unknown { error ( " " unknown ) " " to_string ( ) } } ) }
This little helper allows me to send a request, and get a reply.
This little helper allows me to send a request and get a reply .
child
&ChildRef
body
String
child
&ChildRef
body
String