Clean up documentation

This commit is contained in:
Wojciech Kozlowski 2023-03-29 09:44:59 +09:00
parent f7f497d380
commit 057808c1cc

View File

@ -1,35 +1,37 @@
//! MusicHoard - a music collection manager.
use serde::{Deserialize, Serialize};
use uuid;
/// The [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier).
type Mbid = uuid::Uuid;
/// [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) (MBID).
pub type Mbid = uuid::Uuid;
/// An artist. May be linked to MusicBrainz.
/// [Artist](https://musicbrainz.org/doc/Artist).
#[derive(Deserialize, Serialize)]
pub struct Artist {
pub name: String,
pub mbid: Option<Mbid>,
}
/// A single track on a release.
/// [Track](https://musicbrainz.org/doc/Track).
#[derive(Deserialize, Serialize)]
pub struct Track {
pub number: u32,
pub title: String,
pub artist: Artist,
pub mbid: Option<Mbid>,
}
/// MusicHoard release corresponds to MusicBrainz' concept of a release. However, it does not link
/// to MusicBrainz as the intention of MusicHoard is to manage releases locally.
/// [Release](https://musicbrainz.org/doc/Release).
#[derive(Deserialize, Serialize)]
pub struct Release {
pub title: String,
pub artist: String,
pub tracks: Vec<Track>,
pub mbid: Option<Mbid>,
}
/// MusicHoard uses MusicBrainz [primary release group
/// type](https://musicbrainz.org/doc/Release_Group/Type)
/// [Release group primary type](https://musicbrainz.org/doc/Release_Group/Type).
#[derive(Deserialize, Serialize)]
pub enum ReleaseGroupType {
Album,
@ -38,7 +40,7 @@ pub enum ReleaseGroupType {
Other,
}
/// MusicHoard uses MusicBrainz' [Release Group concept](https://musicbrainz.org/doc/Release_Group).
/// [Release group](https://musicbrainz.org/doc/Release_Group).
#[derive(Deserialize, Serialize)]
pub struct ReleaseGroup {
pub r#type: ReleaseGroupType,