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

Function to_exit_code

crates/bench-api/src/lib.rs:414–422  ·  view source on GitHub ↗

Helper function for converting a Rust result to a C error code. This will print an error indicating some information regarding the failure.

(result: impl Into<Result<T>>)

Source from the content-addressed store, hash-verified

412///
413/// This will print an error indicating some information regarding the failure.
414fn to_exit_code<T>(result: impl Into<Result<T>>) -> ExitCode {
415 match result.into() {
416 Ok(_) => OK,
417 Err(error) => {
418 eprintln!("{error:?}");
419 ERR
420 }
421 }
422}
423
424/// This structure contains the actual Rust implementation of the state required
425/// to manage the Wasmtime engine between calls.

Callers 4

wasm_bench_createFunction · 0.85
wasm_bench_compileFunction · 0.85
wasm_bench_instantiateFunction · 0.85
wasm_bench_executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected