MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / handle_result

Function handle_result

crates/c-api/src/error.rs:32–43  ·  view source on GitHub ↗
(
    result: Result<T>,
    ok: impl FnOnce(T),
)

Source from the content-addressed store, hash-verified

30}
31
32pub(crate) fn handle_result<T>(
33 result: Result<T>,
34 ok: impl FnOnce(T),
35) -> Option<Box<wasmtime_error_t>> {
36 match result {
37 Ok(value) => {
38 ok(value);
39 None
40 }
41 Err(error) => Some(Box::new(wasmtime_error_t { error })),
42 }
43}
44
45pub(crate) fn bad_utf8() -> Option<Box<wasmtime_error_t>> {
46 Some(Box::new(wasmtime_error_t {

Calls 1

newFunction · 0.50

Tested by

no test coverage detected