Daily Rust Tutorial 045: Overview of Smart Pointers

Daily Rust Tutorial 045: Overview of Smart Pointers

We continue our learning of <span>Rust</span> and today we will explore the knowledge related to smart pointers. This article will provide a simple overview. We will discuss several of the most commonly used types in the standard library: • <span>Box<T></span>, used for allocating values on the heap • <span>Rc<T></span>, a reference-counted type that allows multiple … Read more

Characteristics of Smart Pointers in Rust and Their Specific Use Cases

Smart pointers in Rust are a core manifestation of its ownership and memory management system. They not only manage heap memory but also provide safe and flexible data sharing and mutability control solutions for different scenarios through additional metadata and specific behaviors. The table below can help you quickly grasp the main characteristics and applicable … Read more

Practical Guide to Rust’s Borrow Checker: From Confrontation to Harmonious Coexistence

Introduction If you are learning Rust, you have undoubtedly encountered the frustrating errors from the Borrow Checker. Many beginners feel disheartened: why does the compiler reject my code when the logic seems correct? This article will delve into the core mechanisms of Rust’s Borrow Checker, helping you understand the design philosophy behind it and providing … Read more