rust-rocket 0.14.1

A client implementation of GNU Rocket.
Documentation
use rust_rocket::RocketPlayer;
use std::error::Error;
use std::fs::File;
use std::time::Duration;

static TRACKS_FILE: &str = "tracks.bin";

fn main() -> Result<(), Box<dyn Error>> {
    let rocket = {
        // Open previously saved file (see examples/edit.rs)
        let mut file = File::open(TRACKS_FILE)?;
        // Deserialize from the file into Vec<Track> using bincode
        let bincode_conf = bincode::config::standard();
        let tracks = bincode::decode_from_std_read(&mut file, bincode_conf)?;
        // Construct a new read-only, offline RocketPlayer
        RocketPlayer::new(tracks)
    };
    println!("Tracks loaded from {}", TRACKS_FILE);

    let mut current_row = 0;

    loop {
        println!(
            "value: {:?} (row: {:?})",
            rocket
                .get_track("test")
                .unwrap()
                .get_value(current_row as f32),
            current_row
        );

        current_row += 1;
        std::thread::sleep(Duration::from_millis(32));
    }
}