Crate mpd [] [src]

MPD client for Rust

This crate tries to provide idiomatic Rust API for Music Player Daemon. The main entry point to the API is Client struct, and inherent methods of the struct follow MPD protocol for most part, making use of traits to overload different parameters for convenience.

Usage

[dependencies]
mpd = "*"
extern crate mpd;

use mpd::Client;
use std::net::TcpStream;

let mut conn = Client::connect("127.0.0.1:6600").unwrap();
conn.volume(100).unwrap();
conn.load("My Lounge Playlist", ..).unwrap();
conn.play().unwrap();
println!("Status: {:?}", conn.status());

Reexports

pub use client::Client;
pub use status::{ReplayGain, State, Status};
pub use version::Version;
pub use song::{Id, Song};
pub use playlist::Playlist;
pub use output::Output;
pub use plugin::Plugin;
pub use stats::Stats;
pub use search::{Query, Term};
pub use message::{Channel, Message};
pub use idle::{Idle, Subsystem};
pub use mount::{Mount, Neighbor};

Modules

client

This module defines client data structure — the main entry point to MPD communication

error

This module defines different errors occurring during communication with MPD.

idle

The module defines structures and protocols for asynchronous MPD communication

message

The module defines structures for MPD client-to-client messaging/subscription protocol

mount

The module describes data structures for MPD (virtual) mounts system

output

The module describes output

playlist

The module defines playlist data structures

plugin

The module defines decoder plugin data structures

reply

The module describes all possible replies from MPD server.

search
song

The module defines song structs and methods.

stats

The module describes DB and playback statistics

status

The module defines MPD status data structures

version

This module defines MPD version type and parsing code