diff --git a/src/lib.rs b/src/lib.rs index f4271de..aae6c3d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,7 @@ pub fn parse_response<'a, I: Iterator, T: de::DeserializeOwned>( } /// 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. /// @@ -106,7 +107,8 @@ pub fn parse_response_vec<'a, I: Iterator, T: de::DeserializeOwn .collect() } -/// Parse the `playlist` command, a list of key-value pairs, as a vector of filenames. +/// Parse the `playlist` command as a vector of filenames. +/// /// The playlist index of each item is *not* included because, if needed, /// it can easily be added with `.enumerate()`. /// diff --git a/src/structs.rs b/src/structs.rs index c554999..8fa7827 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -3,7 +3,8 @@ use helpers::*; use serde::Deserialize; use std::{fmt, time::Duration}; -/// All information about a track. This is returned by the `currentsong` or `queue` commands. +/// All information about a track. This is returned by the `currentsong`, `queue`, or +/// `playlistinfo` commands. #[derive(Deserialize, Clone, Debug, Default, PartialEq)] #[serde(default)] pub struct Track { @@ -53,6 +54,7 @@ pub struct Track { pub struct UnitResponse {} /// 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. @@ -118,6 +120,7 @@ pub struct Status { } /// An object in the file system, as returned by the `listfiles` command. +/// /// For directories, the `size` will be `-1`, and [`is_directory`] is provided to check that. /// /// [`is_directory`]: #method.is_directory