Separate docstring summary from content

This commit is contained in:
kageru 2020-07-24 17:19:43 +02:00
parent 5889512732
commit f3738b1af7
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2
2 changed files with 7 additions and 2 deletions

View File

@ -58,6 +58,7 @@ pub fn parse_response<'a, I: Iterator<Item = &'a str>, T: de::DeserializeOwned>(
} }
/// Parse an iterator of string slices into a vector of `T`, splitting at any occurence of `first_key`. /// 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 /// 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. /// playlist, where the `file: ` key denotes the start of a new item.
/// ///
@ -106,7 +107,8 @@ pub fn parse_response_vec<'a, I: Iterator<Item = &'a str>, T: de::DeserializeOwn
.collect() .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, /// The playlist index of each item is *not* included because, if needed,
/// it can easily be added with `.enumerate()`. /// it can easily be added with `.enumerate()`.
/// ///

View File

@ -3,7 +3,8 @@ use helpers::*;
use serde::Deserialize; use serde::Deserialize;
use std::{fmt, time::Duration}; 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)] #[derive(Deserialize, Clone, Debug, Default, PartialEq)]
#[serde(default)] #[serde(default)]
pub struct Track { pub struct Track {
@ -53,6 +54,7 @@ pub struct Track {
pub struct UnitResponse {} pub struct UnitResponse {}
/// The position of an item in a list with an optional total length. /// The position of an item in a list with an optional total length.
///
/// Can be used for e.g. track number, /// Can be used for e.g. track number,
/// where `Position { 3, 12 }` represents track 3 of a CD with 12 tracks, /// where `Position { 3, 12 }` represents track 3 of a CD with 12 tracks,
/// or disc numbers in a multi-disc set. /// 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. /// 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. /// For directories, the `size` will be `-1`, and [`is_directory`] is provided to check that.
/// ///
/// [`is_directory`]: #method.is_directory /// [`is_directory`]: #method.is_directory