1 mod bindings { 2 wit_bindgen::generate!({ 3 path: "../misc/component-async-tests/wit", 4 world: "error-context-callee", 5 }); 6 7 use super::Component; 8 export!(Component); 9 } 10 use wit_bindgen::rt::async_support::ErrorContext; 11 12 struct Component; 13 14 impl bindings::exports::local::local::run_result::Guest for Component { 15 async fn run_fail() -> Result<(), ErrorContext> { 16 Err(ErrorContext::new("error")) 17 } 18 19 async fn run_pass() -> Result<(), ErrorContext> { 20 Ok(()) 21 } 22 } 23 24 impl bindings::exports::local::local::run::Guest for Component { 25 async fn run() {} 26 } 27 28 // Unused function; required since this file is built as a `bin`: 29 fn main() {} 30