11.6 Summary
This chapter focused on implementing typical data structures in Rust, starting with detailed implementations of both singly linked lists and doubly linked lists. You learned how these lists are constructed, the key differences between them, and the use cases where each excels. In this chapter, we also introduced you to the concept of reference cycles, a common issue in linked structures that can lead to memory leaks. Through practical examples and explanations, we provided insights into how to avoid such pitfalls when working with references in Rust. By the end of this chapter, we hope you are better equipped to build efficient data structures and manage memory correctly.
Next, we’ll discuss useful patterns for handling structs, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access