7 releases (breaking)

0.6.0 Aug 29, 2021
0.5.0 Jan 10, 2021
0.4.0 Nov 21, 2020
0.3.0 Aug 20, 2020
0.1.0 May 28, 2020

#2398 in Network programming

Download history 64/week @ 2022-06-05 8/week @ 2022-06-12 19/week @ 2022-06-19 11/week @ 2022-06-26 25/week @ 2022-07-03 23/week @ 2022-07-10 22/week @ 2022-07-17 26/week @ 2022-07-24 31/week @ 2022-07-31 31/week @ 2022-08-07 22/week @ 2022-08-14 26/week @ 2022-08-21 15/week @ 2022-08-28 45/week @ 2022-09-04 23/week @ 2022-09-11 20/week @ 2022-09-18

107 downloads per month
Used in 4 crates

MIT/Apache

39KB
1K SLoC

crates.io version docs.rs

async-mpd

Runtime agnostic Mpd client library for Rust

Example:

use tokio as runtime;
// For async-std instead
//use async_std as runtime;
use async_mpd::{MpdClient, cmd};

#[runtime::main]
async fn main() -> Result<(), async_mpd::Error> {
    // Connect to server
    let mut mpd = MpdClient::new();
    mpd.connect("localhost:6600").await?;

    // Get all tracks in the play queue and display them
    let queue = mpd.queue().await?;
    for track in queue {
        println!("{:?} - {:?}", track.artist, track.title);
    }

    // Play track nr 2 in the queue
    mpd.playid(2).await?;

    // Get and print the current server status using the command api
    let status = mpd.exec(cmd::Status).await?;
    println!("{:?}", status);

    // Set the volume to 50%
    mpd.setvol(50).await?;

    Ok(())
}

Dependencies

~1.1–2.2MB
~42K SLoC