MCPcopy Create free account
hub / github.com/bytecodealliance/component-docs / run

Method run

component-model/examples/example-host/src/main.rs:23–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21
22impl AddApp {
23 async fn run(self) -> anyhow::Result<()> {
24 let sum1 = async_add::add(self.component.clone(), self.x, self.y).await?;
25 let sum2 = sync_add::add(self.component, self.x, self.y)?;
26 assert_eq!(sum1, sum2);
27 println!("{} + {} = {sum1}", self.x, self.y);
28 Ok(())
29 }
30}
31
32#[async_std::main]

Callers 1

mainFunction · 0.45

Calls 1

addFunction · 0.70

Tested by

no test coverage detected