Skip to content

18 · Modules

Rust · rustc · Cargo

Compile typed Rust functions and copied records into a target-specific library. Cargo dependencies join the locked workflow. Deployed artifacts do not need rustc or source files; retained receiver objects and open generics need adapters.

On this page

Run locally with the matching plugin and runtime. These examples do not run in the browser playground.

Rust / rustc · Cargo.

45-extern-rust.zolo
use plugin rust::{rust}

extern rust fn exact(value: int) -> int {
    value
}

extern rust fn upper(value: str) -> str {
    value.to_uppercase()
}

extern rust async fn later(value: int) -> int {
    async { value + 1 }.await
}

extern rust from "./rust_fixtures/math.rs" use {add}

print(exact(9007199254740993)) // expected: 9007199254740993
print(upper("hello Rust")) // expected: HELLO RUST
print(add(left: 20, right: 22)) // expected: 42
print(await later(41)) // expected: 42

Requires the Zolo CLI/host — open in the playground or run locally.

Preparation and deployment

Source-free packaging can retain prepared foreign artifacts, but does not remove runtime or platform dependencies. VM, native and LLVM hosting are covered; foreign bindings reject unsupported WebAssembly targets. The recent provider acceptance covers Windows x64. Python acceptance specifically covers CPython 3.12; other platforms need their own verification.

Reference overview

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br