diff --git a/src/trap.zig b/src/trap.zig index e88155f..0f29e33 100644 --- a/src/trap.zig +++ b/src/trap.zig @@ -76,14 +76,14 @@ pub const TrapCode = enum(u8) { } }; -pub const Trap = struct { +pub const Trap = opaque { /// Creates a new trap. /// The `Trap` returned is owned by the caller. - pub fn init(message: [:0]const u8) Trap { + pub fn init(message: [:0]const u8) *Trap { return wasmtime_trap_new(message.ptr, message.len + 1); } - pub fn copy(self: *const Trap) Trap { + pub fn copy(self: *const Trap) *Trap { return wasm_trap_copy(self); }