Trap::I32Exit is a better name
This commit is contained in:
@@ -929,8 +929,15 @@ impl Pointee for str {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
/// A runtime-independent way for Wiggle to terminate WebAssembly execution.
|
||||
/// Functions that are marked `(@witx noreturn)` will always return a Trap.
|
||||
/// Other functions that want to Trap can do so via their `UserErrorConversion`
|
||||
/// trait, which transforms the user's own error type into a `Result<abierror, Trap>`.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Trap {
|
||||
I32(i32),
|
||||
/// A Trap which indicates an i32 (posix-style) exit code. Runtimes may have a
|
||||
/// special way of dealing with this for WASI embeddings and otherwise.
|
||||
I32Exit(i32),
|
||||
/// Any other Trap is just an unstructured String, for reporting and debugging.
|
||||
String(String),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user