Expand description
mpd clients and associated utilities.
Introduction
This module contains basic types implementing various MPD client operations (cf. the mpd protocol). Since issuing the “idle” command will tie up the connection, MPD clients often use multiple connections to the server (one to listen for updates, one or more on which to issue commands). This modules provides two different client types: Client for general-purpose use and IdleClient for long-lived connections listening for server notifiations.
Note that there is another idiom (used in libmpdel, e.g.): open a single connection & issue an “idle” command. When you want to issue a command, send a “noidle”, then the command, then “idle” again. This isn’t a race condition, as the server will buffer any changes that took place when you were not idle & send them when you re-issue the “idle” command. This crate however takes the approach of two channels (like mpdfav).
Structs
- A description of the current track, suitable for our purposes (as in, it only tracks the attributes needed for this module’s functionality).
- MPD client for “idle” connections.
Enums
- An MPD client error
- Enumerated list of MPD operations; used in Error::Protocol to distinguish which operation it was that elicited the protocol error.
- The MPD player itself can be in one of three states: playing, paused or stopped. In the first two there is a “current” song.
Traits
Functions
- Quote an argument by backslash-escaping “ & \ characters