January 2018
Beginner to intermediate
454 pages
10h 8m
English
We'll start by adding a field indicating whether the player is in pause or not. This field will be changed by methods such as play or resume. However, remember that our Playlist is wrapped in an Rc, so that we can use it in different places, namely in the event handlers. Also, remember that Rust forbids mutation when there are mutable references to a value. How can we update this field while still using a reference-counted pointer? One way is to use interior mutability.
Read now
Unlock full access