crossbind
GitHub
← All extensions

rust

Rust, as crossbind binds it: .rs files, cargo: imports, packages.cargo and cargo packages.

Package @crossbind/extension-rustnpm ↗Source ↗

crossbind has it as a dependency: there is nothing to install or list.

Use

JavaScript
// crossbind.config.js
export default {
packages: {
cargo: { uuid: '{ version = "1", features = ["v4"] }' },
},
};
JavaScript
import { initNative } from './native/native.h';
import { Uuid } from 'cargo:uuid';
 
await initNative();
const id = Uuid.newV4().toString();

rust.md has the three ways to import Rust, what plain Rust maps to and the license rows.

Platforms

Web, Android and iOS builds, and Node.js addons for Linux, macOS and Windows; platform: 'wasi' skips Rust. A build in a toolchain image runs Rust's tool image beside it, and iOS and macOS builds, as every build under RUNNER=LOCAL, use the Rust on your machine. rust.md says what that takes.

Only crossbind's own extensions give a language, so no extension crossbind.config.js lists takes this one's place.

Type to search every guide page and section.
↑↓ navigate↵ openesc close