[][src]Crate async_mpd

Async-mpd

Async-std based mpd client library for Rust

Example:

use async_mpd::MpdClient;

#[async_std::main]
async fn main() -> Result<(), async_mpd::Error> {
    // Connect to server
    let mut mpd = MpdClient::new("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
    println!("{:?}", mpd.status().await?);

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

    Ok(())
}

Structs

Directory

Directory on the server

Filter

Abstraction over search filter

MpdClient

Mpd Client

Playlist

Playlist on the server

Stats

Mpd database statistics

Status

Mpd status response

Track

Track

Enums

Error

Error

FilterExpr

Search expression used by search function

Mixed

Response from commands that returns entries with metadata and tags

Subsystem

Subsystem

Tag

Track tags

Traits

ToFilterExpr