Crate mparsed

Source

Structs§

File
Position
The position of an item in a list with an optional total length. Can be used for e.g. track number, where Position { 3, 12 } represents track 3 of a CD with 12 tracks, or disc numbers in a multi-disc set.
Stats
Database statistics as returned by the stats command.
Status
Current status as returned by status.
Track
All information about a track. This is returned by the currentsong or queue commands.
UnitResponse
An empty struct that can be used as the response data for commands that only ever return OK or an error message, e.g. consume or other boolean toggles.

Enums§

State

Functions§

parse_playlist
Parse the playlist command, a list of key-value pairs, as a vector of filenames. The playlist index of each item is not included because, if needed, it can easily be added with .enumerate().
parse_response
Parse an interator of string slices into T, returning Ok(T) if the data could be deserialized and the MPD response ended with OK or Error if the deserialization failed or MPD sent an error message.
parse_response_vec
Parse an iterator of string slices into a vector of T, splitting at any occurence of first_key. One possible use for this is the playlistinfo command which returns all items in the current playlist, where the file: key denotes the start of a new item.