#[non_exhaustive]pub enum ArtistRole {
Primary,
Featured,
Remixer,
Producer,
}Expand description
What an artist did on the track (R7).
use trackparse::{parse, ArtistRole};
let track = parse("Noisia feat. Foreign Beggars - Shellshock (prod. by Phace)");
let roles: Vec<ArtistRole> = track.artists.iter().map(|a| a.role).collect();
assert_eq!(roles, [ArtistRole::Primary, ArtistRole::Featured, ArtistRole::Producer]);
assert_eq!(ArtistRole::Featured.to_string(), "featured");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Primary
"primary" in the spec and in JSON.
Featured
"featured" in the spec and in JSON.
Remixer
"remixer" in the spec and in JSON.
Producer
"producer" in the spec and in JSON.
Implementations§
Source§impl ArtistRole
impl ArtistRole
Sourcepub const ALL: &'static [ArtistRole]
pub const ALL: &'static [ArtistRole]
Every value, in the spec’s order.
Sourcepub fn from_name(name: &str) -> Option<ArtistRole>
pub fn from_name(name: &str) -> Option<ArtistRole>
The value with that spec name (exact match), or None.
Trait Implementations§
Source§impl Clone for ArtistRole
impl Clone for ArtistRole
impl Copy for ArtistRole
Source§impl Debug for ArtistRole
impl Debug for ArtistRole
Source§impl<'de> Deserialize<'de> for ArtistRole
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ArtistRole
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> Result<ArtistRole, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<ArtistRole, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ArtistRole
impl Display for ArtistRole
impl Eq for ArtistRole
Source§impl FromStr for ArtistRole
impl FromStr for ArtistRole
Source§impl Hash for ArtistRole
impl Hash for ArtistRole
Source§impl PartialEq for ArtistRole
impl PartialEq for ArtistRole
Source§impl Serialize for ArtistRole
Available on crate feature serde only.
impl Serialize for ArtistRole
Available on crate feature
serde only.impl StructuralPartialEq for ArtistRole
Auto Trait Implementations§
impl Forget for ArtistRole
impl Freeze for ArtistRole
impl Move for ArtistRole
impl RefUnwindSafe for ArtistRole
impl Send for ArtistRole
impl Sync for ArtistRole
impl Unpin for ArtistRole
impl UnsafeUnpin for ArtistRole
impl UnwindSafe for ArtistRole
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