pub struct ParsedTrack {
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 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,"flags":{"explicit":false,"clean":false,"unknownArtist":false,"#,
r#""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.
flags: FlagsYes/no facts.
junk: Vec<Junk>Fragments that say nothing about the track.
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
Available on crate feature
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Available on crate feature
serde only.impl StructuralPartialEq for ParsedTrack
Auto Trait Implementations§
impl Forget for ParsedTrack
impl Freeze for ParsedTrack
impl Move for ParsedTrack
impl RefUnwindSafe for ParsedTrack
impl Send for ParsedTrack
impl Sync for ParsedTrack
impl Unpin for ParsedTrack
impl UnsafeUnpin for ParsedTrack
impl UnwindSafe for ParsedTrack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more