#[non_exhaustive]pub enum FeatPlacement {
Source,
Artist,
Title,
Omit,
}Expand description
Where format_track_with writes featured artists (R11.2).
use trackparse::{format_track_with, parse, FeatPlacement, FormatOptions};
let track = parse("Sub Focus - Out the Blue ft. Alice Gold");
let with = |feat| format_track_with(&track, &FormatOptions::new().feat(feat));
assert_eq!(with(FeatPlacement::Source), "Sub Focus - Out the Blue (ft. Alice Gold)");
assert_eq!(with(FeatPlacement::Artist), "Sub Focus ft. Alice Gold - Out the Blue");
assert_eq!(with(FeatPlacement::Title), "Sub Focus - Out the Blue (ft. Alice Gold)");
assert_eq!(with(FeatPlacement::Omit), "Sub Focus - Out the Blue");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.
Source
"source" in the spec and in JSON.
Artist
"artist" in the spec and in JSON.
Title
"title" in the spec and in JSON.
Omit
"omit" in the spec and in JSON.
Implementations§
Source§impl FeatPlacement
impl FeatPlacement
Sourcepub const ALL: &'static [FeatPlacement]
pub const ALL: &'static [FeatPlacement]
Every value, in the spec’s order.
Sourcepub fn from_name(name: &str) -> Option<FeatPlacement>
pub fn from_name(name: &str) -> Option<FeatPlacement>
The value with that spec name (exact match), or None.
Trait Implementations§
Source§impl Clone for FeatPlacement
impl Clone for FeatPlacement
impl Copy for FeatPlacement
Source§impl Debug for FeatPlacement
impl Debug for FeatPlacement
Source§impl Default for FeatPlacement
impl Default for FeatPlacement
Source§impl<'de> Deserialize<'de> for FeatPlacement
Available on crate feature serde only.
impl<'de> Deserialize<'de> for FeatPlacement
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> Result<FeatPlacement, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<FeatPlacement, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FeatPlacement
impl Display for FeatPlacement
impl Eq for FeatPlacement
Source§impl FromStr for FeatPlacement
impl FromStr for FeatPlacement
Source§impl Hash for FeatPlacement
impl Hash for FeatPlacement
Source§impl PartialEq for FeatPlacement
impl PartialEq for FeatPlacement
Source§impl Serialize for FeatPlacement
Available on crate feature serde only.
impl Serialize for FeatPlacement
Available on crate feature
serde only.impl StructuralPartialEq for FeatPlacement
Auto Trait Implementations§
impl Forget for FeatPlacement
impl Freeze for FeatPlacement
impl Move for FeatPlacement
impl RefUnwindSafe for FeatPlacement
impl Send for FeatPlacement
impl Sync for FeatPlacement
impl Unpin for FeatPlacement
impl UnsafeUnpin for FeatPlacement
impl UnwindSafe for FeatPlacement
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