Summary
This chapter started by showing you how to decode MP3 data with the simplemad
crate. You then learned how to write a music engine, this showed you how to use threads and different threading objects such as Mutex
, lock-free data structures, and condition variables. You also learned how Rust can ensure thread safety. You also saw how to mutable the fields of a value when you have an immutable reference with interior mutability. During the whole chapter, we added the missing features to the music player such as play, pause, previous, and next song.
In the next chapter, we'll improve the modularity of the music player by rewriting it with the relm
crate.