Standard Library
Option
Result
Recipe | Crates |
---|---|
Handle Recoverable Errors with Result | |
Retrieve or Transform Values in Result | |
Get Reference to Values Inside a Result | |
Result vs Option |
Smart Pointers
Recipe | Crates |
---|---|
[RefCell ][ex-standard_library-refcell] | |
[Cell ][ex-standard_library-cell] | |
[OnceCell ][ex-standard_library-oncecell] |
Box
Recipe | Crates |
---|---|
Store Data on the Heap with Box | |
Box Use Cases | |
Use Box to store Dynamically Sized Types | |
Implement Recursive Data Structures with Box | |
Use Box as a Smart Pointer to Owned Trait Objects |
Copy-On-Write (Cow)
AsRef
Recipe | Crates |
---|---|
Accept Arguments of Multiple Types with AsRef | |
Use as_ref to Get a Reference to the Contained Value of a Smart Pointer | |
AsRef vs. Deref vs. Borrow |