Introduction to Developing Canisters in Rust
Rust is a powerful and type-sound modern programming language with an active developer community. Because Rust compiles to WebAssembly, it offers a rich development environment for writing dapps to run on the Internet Computer blockchain. To help pave the way for writing dapps in Rust that can be deployed on the Internet Computer blockchain, DFINITY provides the Rust canister development kit (Rust CDK) to simplify the process.
The CDK consists of the following crates:
The core of Rust CDK is the
ic-cdkcrate. It provides the core methods that enable Rust programs to interact with the Internet Computer blockchain system API.
ic-cdk-macroscrate defines the procedural macros (e.g.
import) that facilitate building operation endpoints and APIs.
ic-cdk-timerscrate provides an API to schedule multiple and periodic tasks.
There are a few examples to get you started building Rust Canisters.
Also, it is much easier to use
dfx instead of setting up the project from scratch. See the Rust Quickstart for a simple walkthrough.