Better Wasmtime API for embedder (#287)
* Migrate wasm-rust-api code to wasmtime.
This commit is contained in:
committed by
Dan Gohman
parent
8ea883a603
commit
f88e92a57c
19
wasmtime-api/src/trap.rs
Normal file
19
wasmtime-api/src/trap.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
#[derive(Fail, Debug)]
|
||||
#[fail(display = "Wasm trap")]
|
||||
pub struct Trap {
|
||||
message: String,
|
||||
}
|
||||
|
||||
impl Trap {
|
||||
pub fn new(message: String) -> Trap {
|
||||
Trap { message }
|
||||
}
|
||||
|
||||
pub fn fake() -> Trap {
|
||||
Trap::new("TODO trap".to_string())
|
||||
}
|
||||
|
||||
pub fn message(&self) -> &str {
|
||||
&self.message
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user