21 lines
397 B
Rust
21 lines
397 B
Rust
|
|
mod bindings {
|
||
|
|
wit_bindgen::generate!({
|
||
|
|
path: "wit",
|
||
|
|
world: "echo-component",
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
struct Echo;
|
||
|
|
|
||
|
|
impl bindings::Guest for Echo {
|
||
|
|
fn init(_config: Vec<u8>) -> Result<(), bindings::ServiceError> {
|
||
|
|
Ok(())
|
||
|
|
}
|
||
|
|
|
||
|
|
fn invoke(input: Vec<u8>) -> Result<Vec<u8>, bindings::ServiceError> {
|
||
|
|
Ok(input)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
bindings::export!(Echo with_types_in bindings);
|