Skip to main content

Introduction to working with 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, {company-id} provides some tools to simplify the process.

Collectively, these tools are referred to as the DFINITY Canister Development Kit (CDK) for Rust and consist of the following main libraries:

PackageDescription
ic-typesThe ic-types crate defines the types used to communicate with the decentralized Internet Computer blockchain, and when building dapps to be deployed as canisters on the Internet Computer blockchain.
ic-agentThe ic-agent library enables direct communication with the Internet Computer blockchain.
ic-utilsThe ic-utils library provides utilities for managing calls and dapps deployed as canisters.
ic-cdkThe ic-cdk provides the core methods that enable Rust programs to interact with the Internet Computer blockchain system API. This library serves as the runtime core of the Rust CDK.
ic-cdk-macrosThe ic-cdk-macros library defines the procedural macros that facilitate building operation endpoints and APIs. This library includes macros for update, query, import and other important operations.
ic-cdk-optimizerThe ic-cdk-optimizer is a helper library used to reduce the size of WebAssembly modules.

The following diagram provides a simplified view of the Rust Canister Development Kit (CDK) building blocks from the lowest to highest level of abstraction.

Rust building blocks