MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / ping

Method ping

tests/runtime-async/async/ping-pong/test.rs:10–17  ·  view source on GitHub ↗
(x: FutureReader<String>, y: String)

Source from the content-addressed store, hash-verified

8
9impl crate::exports::my::test::i::Guest for Component {
10 async fn ping(x: FutureReader<String>, y: String) -> FutureReader<String> {
11 let msg = x.await + y.as_str();
12 let (tx, rx) = wit_future::new(|| unreachable!());
13 wit_bindgen::spawn_local(async move {
14 tx.write(msg).await.unwrap();
15 });
16 rx
17 }
18
19 async fn pong(x: FutureReader<String>) -> String {
20 x.await

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
spawn_localFunction · 0.85
as_strMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected