pub struct ParsedTrack {Show 13 fields
pub input: String,
pub mode: Mode,
pub position: Option<Position>,
pub timestamp: Option<Timestamp>,
pub artists: Vec<Artist>,
pub title: String,
pub full_title: String,
pub versions: Vec<Version>,
pub year: Option<u32>,
pub label: Option<String>,
pub flags: Flags,
pub junk: Vec<Junk>,
pub warnings: Vec<Warning>,
}Expand description
The result of parse: everything recognised in one track string.
Anything recognised is in a field; anything not recognised stays in title verbatim.
let track = trackparse::parse("Noisia - Stigma (2015)");
assert_eq!(
track.to_json(),
concat!(
r#"{"input":"Noisia - Stigma (2015)","mode":"clean","position":null,"#,
r#""timestamp":null,"artists":[{"name":"Noisia","role":"primary","joiner":null,"#,
r#""source":"artist"}],"title":"Stigma","fullTitle":"Stigma","versions":[],"#,
r#""year":2015,"label":null,"flags":{"explicit":false,"clean":false,"#,
r#""unknownArtist":false,"unknownTitle":false},"junk":[],"warnings":[]}"#
)
);Fields§
§input: StringThe string that was parsed, unchanged.
mode: ModeThe mode it was parsed in.
position: Option<Position>A leading track number.
timestamp: Option<Timestamp>A leading cue time.
artists: Vec<Artist>Primary, featured and producer credits, in the order written. Remixers are in
versions; all_artists gives both.
title: StringThe title without versions, featured credits and junk.
full_title: StringThe title with its versions, as written (fullTitle in JSON).
versions: Vec<Version>Remixes, edits and other versions, in the order written.
year: Option<u32>A release year found outside the versions.
label: Option<String>The record label after a spaced bullet on the title side (R8.7):
Age Of Spin • WEAREHUMANS gives WEAREHUMANS. Not JunkKind::Label, which is a label
name in brackets such as [NCS Release].
flags: FlagsYes/no facts.
junk: Vec<Junk>Text that is not part of the track’s identity, in text order.
warnings: Vec<Warning>Guesses the caller may want to check.
Implementations§
Trait Implementations§
Source§impl Clone for ParsedTrack
impl Clone for ParsedTrack
Source§impl Debug for ParsedTrack
impl Debug for ParsedTrack
Source§impl<'de> Deserialize<'de> for ParsedTrack
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ParsedTrack
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ParsedTrack
Source§impl Hash for ParsedTrack
impl Hash for ParsedTrack
Source§impl PartialEq for ParsedTrack
impl PartialEq for ParsedTrack
Source§impl Serialize for ParsedTrack
Available on crate feature serde only.
impl Serialize for ParsedTrack
serde only.