Skip to content

Commit

Permalink
Merge pull request #71 from naglis/doc-comment-update
Browse files Browse the repository at this point in the history
Doc comment update
  • Loading branch information
kstep authored Nov 30, 2024
2 parents 84a970b + 7aa7b56 commit d26a58e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! This module defines client data structure — the main entry point to MPD communication
//!
//! Almost every method of the `Client` structure corresponds to some command in [MPD protocol][proto].
//! Almost every method of the [`Client`] structure corresponds to some command in [MPD protocol][proto].
//!
//! [proto]: http://www.musicpd.org/doc/protocol/
//! [proto]: https://www.musicpd.org/doc/protocol/
use bufstream::BufStream;

Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::str::FromStr;
use std::string::ParseError as StringParseError;

// Server errors {{{
/// Server error codes, as defined in [libmpdclient](http://www.musicpd.org/doc/libmpdclient/protocol_8h_source.html)
/// Server error codes, as defined in [libmpdclient](https://www.musicpd.org/doc/libmpdclient/protocol_8h_source.html)
#[cfg_attr(feature = "serde", derive(serde_repr::Serialize_repr, serde_repr::Deserialize_repr))]
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
#[repr(u8)]
Expand Down
15 changes: 8 additions & 7 deletions src/idle.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
//! The module defines structures and protocols for asynchronous MPD communication
//!
//! The MPD supports very simple protocol for asynchronous client notifications about
//! different player events. First user issues `idle` command with optional argument
//! to filter events by source subsystem (like "database", "player", "mixer" etc.)
//! different player events. First user issues [`idle`](Client::idle) command
//! with optional argument to filter events by source subsystem (like
//! "database", "player", "mixer" etc.)
//!
//! Once in "idle" mode, client connection timeout is disabled, and MPD will notify
//! client about next event when one occurs (if originated from one of designated
//! subsystems, if specified).
//!
//! (Actually MPD notifies only about general subsystem source of event, e.g.
//! if user changed volume, client will get `mixer` event in idle mode, so
//! it should issue `status` command then and check for any mixer-related field
//! changes.)
//! if user changed volume, client will get [`mixer`](Subsystem::Mixer) event
//! in idle mode, so it should issue [`status`](Client::status) command then and
//! check for any mixer-related field changes.)
//!
//! Once some such event occurs, and client is notified about it, idle mode is interrupted,
//! and client must issue another `idle` command to continue listening for interesting
Expand All @@ -22,8 +23,8 @@
//! since last `idle` command, if they occurred.
//!
//! The module describes subsystems enum only, but the main workflow is determined by
//! [`IdleGuard`](struct.IdleGuard.html) struct, which catches mutable reference
//! to original `Client` struct, thus enforcing MPD contract in regards of (im)possibility
//! [`IdleGuard`] struct, which catches mutable reference
//! to original [`Client`] struct, thus enforcing MPD contract in regards of (im)possibility
//! to send commands while in "idle" mode.
use crate::client::Client;
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
//! MPD client for Rust
//!
//! This crate tries to provide idiomatic Rust API for [Music Player Daemon][mpd].
//! The main entry point to the API is [`Client`](client/struct.Client.html) struct,
//! and inherent methods of the struct follow [MPD protocol][proto] for most part,
//! making use of traits to overload different parameters for convenience.
//! The main entry point to the API is [`Client`] struct, and inherent methods
//! of the struct follow [MPD protocol][proto] for most part, making use of
//! traits to overload different parameters for convenience.
//!
//! [mpd]: http://www.musicpd.org/
//! [proto]: http://www.musicpd.org/doc/protocol/
//! [mpd]: https://www.musicpd.org/
//! [proto]: https://www.musicpd.org/doc/protocol/
//!
//! # Usage
//!
Expand Down
4 changes: 2 additions & 2 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ impl Channel {

/// Create channel with arbitrary name, bypassing name validity checks
///
/// Not recommened! Use `new()` method above instead.
/// Not recommened! Use [`new()`](Channel::new) method above instead.
/// # Safety
/// Only if Channel::is_valid_name(name)
/// Only if [`Channel::is_valid_name(name)`](Channel::is_valid_name)
pub unsafe fn new_unchecked(name: String) -> Channel {
Channel(name)
}
Expand Down
2 changes: 1 addition & 1 deletion src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! a source of songs for its database (like network shares).
//!
//! Possible, but inactive, mounts are named "neighbors" and can be
//! listed with `neighbors()` method.
//! listed with [`neighbors()`](crate::Client::neighbors) method.
use crate::convert::FromMap;
use crate::error::{Error, ProtoError};
Expand Down
1 change: 1 addition & 0 deletions src/search.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(missing_docs)]
//! The module defines data structures used in MPD search queries.
// TODO: unfinished functionality

use crate::proto::{Quoted, ToArguments};
Expand Down
3 changes: 2 additions & 1 deletion src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ pub struct Status {
pub audio: Option<AudioFormat>,
/// current DB updating job number (if DB updating is in progress)
pub updating_db: Option<u32>,
/// last player error (if happened, can be reset with `clearerror()` method)
/// last player error (if happened, can be reset with
/// [`clearerror()`](crate::Client::clearerror) method)
pub error: Option<String>,
/// replay gain mode
pub replaygain: Option<ReplayGain>,
Expand Down

0 comments on commit d26a58e

Please sign in to comment.