Sha256: 30ff3e4fe1184c644a353534b922b307b7ac64b9d8ebf09c7c39fba451b65266

Contents?: true

Size: 294 Bytes

Versions: 19

Compression:

Stored size: 294 Bytes

Contents

fn hello(subject: String) -> String {
    format!("hello, {}", subject)
}

fn main() {
    let _cleanup = unsafe { magnus::embed::init() };

    magnus::define_global_function("hello", magnus::function!(hello, 1));

    magnus::eval::<magnus::value::Qnil>(r#"puts hello("world")"#).unwrap();
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wasmtime-14.0.4 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-14.0.3 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-14.0.1 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-14.0.0 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-13.0.0 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-12.0.1 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-12.0.0 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-11.0.0 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-10.0.1 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-10.0.0 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-9.0.4 ./ext/cargo-vendor/magnus-0.5.5/examples/hello_world.rs
wasmtime-9.0.1 ./ext/cargo-vendor/magnus-0.5.3/examples/hello_world.rs
wasmtime-8.0.0 ./ext/cargo-vendor/magnus-0.5.3/examples/hello_world.rs
wasmtime-7.0.0 ./ext/cargo-vendor/magnus-0.5.2/examples/hello_world.rs
wasmtime-6.0.1 ./ext/cargo-vendor/magnus-0.5.1/examples/hello_world.rs
wasmtime-6.0.0 ./ext/cargo-vendor/magnus-0.5.1/examples/hello_world.rs
wasmtime-5.0.0 ./ext/cargo-vendor/magnus-0.4.4/examples/hello_world.rs
wasmtime-0.4.1 ./ext/cargo-vendor/magnus-0.4.4/examples/hello_world.rs
wasmtime-0.4.0 ./ext/cargo-vendor/magnus-0.4.3/examples/hello_world.rs