Sha256: bd58f701357dfa36b22dd5086de2f7f76daba1d5da7964089d3c62e0a80871a0

Contents?: true

Size: 324 Bytes

Versions: 19

Compression:

Stored size: 324 Bytes

Contents

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

fn main() {
    magnus::Ruby::init(|ruby| {
        ruby.define_global_function("hello", magnus::function!(hello, 1));

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

        Ok(())
    })
    .unwrap()
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/magnus-0.7.1/examples/hello_world.rs
wasmtime-28.0.0 ./ext/cargo-vendor/magnus-0.7.1/examples/hello_world.rs
wasmtime-27.0.0 ./ext/cargo-vendor/magnus-0.7.1/examples/hello_world.rs
wasmtime-26.0.0 ./ext/cargo-vendor/magnus-0.7.1/examples/hello_world.rs
wasmtime-25.0.2 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-25.0.1 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-25.0.0 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-24.0.0 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-23.0.2 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-22.0.0 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-21.0.1 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-20.0.2 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-20.0.0 ./ext/cargo-vendor/magnus-0.6.4/examples/hello_world.rs
wasmtime-18.0.3 ./ext/cargo-vendor/magnus-0.6.2/examples/hello_world.rs
wasmtime-17.0.1 ./ext/cargo-vendor/magnus-0.6.2/examples/hello_world.rs
wasmtime-17.0.0 ./ext/cargo-vendor/magnus-0.6.2/examples/hello_world.rs
wasmtime-16.0.0 ./ext/cargo-vendor/magnus-0.6.2/examples/hello_world.rs
wasmtime-15.0.1 ./ext/cargo-vendor/magnus-0.6.2/examples/hello_world.rs
wasmtime-15.0.0 ./ext/cargo-vendor/magnus-0.6.2/examples/hello_world.rs