Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/examples/component/wasm/guest.rs
1691 views
1
// Use wit_bindgen to generate the bindings from the component model to Rust.
2
// For more information see: https://github.com/bytecodealliance/wit-bindgen/
3
wit_bindgen::generate!({
4
path: "..",
5
world: "convert",
6
});
7
8
struct GuestComponent;
9
10
export!(GuestComponent);
11
12
impl Guest for GuestComponent {
13
fn convert_celsius_to_fahrenheit(x: f32) -> f32 {
14
host::multiply(x, 1.8) + 32.0
15
}
16
}
17
18