There's more...

There are many types that use interior mutability. Among them are Cell, which, instead of handing out references, simply copies the value it stores. This is nice when storing primitive types such as i32 or bool, as they all implement copy anyway.

Others are RwLock and Mutex, which are important for parallelism, as we shall see in their recipes in Chapter 7, Parallelism and Rayon; Access resources in parallel with RwLocks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.131.255