theothergraham edited PR #6359:
issue #6277
This adds C API interfaces to:
- Set the epoch deadline callback to a C function
- Create a wasmtime_error_t from C
theothergraham updated PR #6359.
alexcrichton submitted PR review:
Looks reasonable to me, thanks!
alexcrichton submitted PR review:
Looks reasonable to me, thanks!
alexcrichton created PR review comment:
I think instead of
:?this should use.to_str()on the pointer received to avoid Rust-level string escaping which shows up in the debug representation.
theothergraham created PR review comment:
.to_str()leaves me with the potential to get aUtf8Errorinstead of a&str. I was not sure what the preferred way to deal with such bad input would be, but based on what I see incrates/c-api/src/trap.rs, I think I will go withString::from_utf8_lossy(). Sound good?
alexcrichton created PR review comment:
Yeah I think the
_lossyvariant is fine. That's a reality of working with cross-language FFI here but in the context of "just an error message" the lossy variant should be fine.
theothergraham updated PR #6359.
theothergraham created PR review comment:
Thanks, revised.
alexcrichton has enabled auto merge for PR #6359.
alexcrichton merged PR #6359.
Last updated: Dec 13 2025 at 19:03 UTC