Skip to Content
Rust Programming By Example
book

Rust Programming By Example

by Guillaume Gomez, Antoni Boucher
January 2018
Beginner to intermediate
454 pages
10h 8m
English
Packt Publishing
Content preview from Rust Programming By Example

Adding dependencies

Let's add the following to Cargo.toml:

crossbeam = "^0.3.0"
pulse-simple = "^1.0.0"
simplemad = "^0.8.1"

We also added the pulse-simple and crossbeam crates because we'll need them later. The former will be used to play the songs with pulseaudio and the latter will be used to implement the event loop of the music player engine.

We also need to add the following statements in main.rs:

extern crate crossbeam;
extern crate pulse_simple;
extern crate simplemad;

mod mp3;

In addition to the extern crate statements, we have a mod statement since we'll create a new module for the MP3 decoder.

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.
Start your free trial

You might also like

Rust Programming Cookbook

Rust Programming Cookbook

Claus Matzinger
Rust Web Programming

Rust Web Programming

Maxwell Flitton

Publisher Resources

ISBN: 9781788390637Supplemental Content