Module: Wasmtime

Defined in:
ext/src/ruby_api/mod.rs,
lib/wasmtime/error.rb,
lib/wasmtime/version.rb

Defined Under Namespace

Classes: Caller, ConversionError, Engine, Error, Extern, Func, FuncType, Global, Instance, Linker, Memory, Module, PoolingAllocationConfig, ResultError, Store, Table, Trap, WasiCtx, WasiCtxBuilder, WasiExit

Constant Summary collapse

VERSION =
"26.0.0"

Class Method Summary collapse

Class Method Details

.wat2wasm(wat) ⇒ String

Converts a WAT String into Wasm.

Parameters:

  • wat (String)

Returns:

  • (String)

    The Wasm represented as a binary String.



64
65
66
67
68
69
# File 'ext/src/ruby_api/mod.rs', line 64

pub fn wat2wasm(wat: RString) -> Result<RString, Error> {
        wat::parse_str(unsafe { wat.as_str()? })
            .map(|bytes| RString::from_slice(bytes.as_slice()))
            .map_err(|e| crate::error!("{}", e))
    }
}