Function Exercises

A hands-on exploration of Function - Understand how to define and utilize functions in Rust, including specifying parameters and return types. You'll apply this by implementing `mul` and `div` functions, which take two `u32` inputs and return their product and quotient respectively.


1. Install Rust
A foundational introduction to Setting Up Your Rust Development Environment - Equip yourself for Rust development by installing `rustc` (the compiler) and Cargo (the build system/package manager) using `rustup`. You'll verify your setup and learn essential Cargo commands like `init`, `build`, `run`, `fmt`, and `test` to manage projects. Duration: 4min
2. Hello
An illuminating walkthrough of Understanding Your First Rust Program: `main`, Attributes, and `println!` - Uncover the significance of the `main` function, the role of compiler attributes like `#![allow(unused)]`, and the power of the `println!` macro for output. You'll also get hands-on with organizing and running separate Rust snippets via Cargo's `examples` directory. Duration: 4min
3. Hello Exercises
A foundational step to Your First Rust Program - Discover the core of Rust programming by writing your first `main` function to output "Hello Rust". Get hands-on with `cargo run` to compile and see your new creation come to life. Reading Time: 0min
4. Variable
A detailed walkthrough to Understanding Variables in Rust - Grasp Rust's variable system, including its default immutability, the `mut` keyword, type inference, and the concept of shadowing. Learn to define constants, use type placeholders, and utilize the `println!` macro for various console output methods. Duration: 6min
5. Variable Exercises
A clear primer on Rust Variables & Mutability - Discover how to declare variables in Rust and understand the crucial role of mutability. You'll gain practical experience by modifying a variable's state to make it changeable. Reading Time: 0min
6. Function
A fundamental walkthrough of Getting Started with Functions in Rust - Learn the essentials of defining functions with `fn`, including mandatory type annotations for parameters and return values. Discover the mechanics of returning values, from explicit `return` and implicit expression returns to leveraging tuples for multiple outputs and understanding the unit type `()`. Duration: 4min
7. Function Exercises
A hands-on exploration of Function - Understand how to define and utilize functions in Rust, including specifying parameters and return types. You'll apply this by implementing `mul` and `div` functions, which take two `u32` inputs and return their product and quotient respectively. Reading Time: 0min

Course Overview

About the course

What you'll learn

Introduction to the Rust programming language

Rust variables and functions

Scalar types, arrays, strings, enum, structs, vectors, and hash maps in Rust

Rust control flows: If / else, if let and let else, loop, match

Rust ownership, including borrow and references

Rust error handling

Rust Modules

Rust Traits

Course Description

Who is this course for?

  • Smart Contract Developers
  • Blockchain Engineers
  • Web3 Developers
  • Smart Contract Security Researchers
  • Solutions Architects

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on July 11, 2025