Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Rust for Blockchain Application Development

You're reading from   Rust for Blockchain Application Development Learn to build decentralized applications on popular blockchain technologies using Rust

Arrow left icon
Product type Paperback
Published in Apr 2024
Publisher Packt
ISBN-13 9781837634644
Length 392 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Akhil Sharma Akhil Sharma
Author Profile Icon Akhil Sharma
Akhil Sharma
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1:Blockchains and Rust
2. Chapter 1: Blockchains with Rust FREE CHAPTER 3. Chapter 2: Rust – Necessary Concepts for Building Blockchains 4. Part 2: Building the Blockchain
5. Chapter 3: Building a Custom Blockchain 6. Chapter 4: Adding More Features to Our Custom Blockchain 7. Chapter 5: Finishing Up Our Custom Blockchain 8. Part 3: Building Apps
9. Chapter 6: Using Foundry to Build on Ethereum 10. Chapter 7: Exploring Solana by Building a dApp 11. Chapter 8: Exploring NEAR by Building a dApp 12. Part 4: Polkadot and Substrate
13. Chapter 9: Exploring Polkadot, Kusama, and Substrate 14. Chapter 10: Hands-On with Substrate 15. Part 5: The Future of Blockchains
16. Chapter 11: Future of Rust for Blockchains 17. Index 18. Other Books You May Enjoy

Learning basic Rust concepts

While Rust is quite an extensive language and to cover it completely requires a book of its own, you are advised to supplement your learning with a dedicated Rust book. You can find some examples at https://doc.rust-lang.org/book/. However, the most important concepts that we will often require when working with blockchains can be covered quickly. This is what we will attempt to do here.

First, let’s talk about variables and constants. These are the basic building blocks of any programming language.

Variables and constants

Variables are crucial to Rust as they are values that may change multiple times throughout the lifetime of the program. As can be seen in the following example, defining variables in Rust is extremely simple:

fn main() {
   let x = 5;
   println!("The value of is:{x}");
}

In the preceding code, we assign a value of 5 to x, where x is the variable, after which we print out the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image