Skip to content

Commit

Permalink
feat(component): add an example of depending on an instr'd component
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdickinson committed Oct 10, 2023
1 parent a54cd51 commit b51beda
Show file tree
Hide file tree
Showing 13 changed files with 1,008 additions and 33 deletions.
4 changes: 0 additions & 4 deletions corpus/00-component-instr-command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ edition = "2021"
[package.metadata.component]
package = "example:component-instr-command"

[package.metadata.component.target]
path = "wit"
world = "component-instr-command"

[package.metadata.component.target.dependencies]
"dylibso:observe" = { path = "../../wit/observe.wasm" }

Expand Down
16 changes: 2 additions & 14 deletions corpus/00-component-instr-command/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@ cargo_component_bindings::generate!();

use observe_api::*;

use bindings::Guest;

pub struct Component;

impl Guest for Component {
/// Say hello!
fn hello_world() -> u32 {
span_enter("hello world");
log(log::Level::Info, "hello world");
span_exit();
0xdeadbeef
}
}

fn main() {
span_enter("hello world");
log(log::Level::Info, "hello world");
span_exit();
println!("Hello, world!");
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ package example:component-instr-command

world component-instr-command {
import dylibso:observe/api
export hello-world: func() -> u32
}
Loading

0 comments on commit b51beda

Please sign in to comment.