proto install rust
If you're familiar with Rust, you most likely use rustup, a Rust specific toolchain manager. This overlaps heavily with how proto works, so instead of proto reinventing the wheel here, we simply call rustup
under the hood. Because of this, be aware of the following when using Rust in proto:
- Rust and Cargo must be pre-installed on your system.
- The
~/.cargo/bin
directory must be in yourPATH
. - We don't install Rust to
~/.proto/tools/rust
but instead reference~/.rustup/toolchains
. - We don't create shims for
cargo
,rustup
, etc.
Since we don't create shims for cargo
, rustup
, etc, we can't detect Rust versions at runtime. However, rustup
supports this through the
rust-toolchain.toml
file. We suggest using this file.
Build the plugin:
cargo build --target wasm32-wasi
Test the plugin by running proto
commands. Requires proto >= v0.14.
proto install rust-test
proto list-remote rust-test