#[non_exhaustive]pub enum Mode {
Clean,
Youtube,
Filename,
Tracklist,
}Expand description
The mode a string was parsed in (R2). Tracklist is only used when asked for (R13.6);
auto never resolves to it.
use trackparse::{parse, Mode};
assert_eq!(parse("Noisia - Stigma").mode, Mode::Clean);
assert_eq!(parse("Noisia - Stigma (Official Video)").mode, Mode::Youtube);
assert_eq!(parse("01_noisia_-_stigma.mp3").mode, Mode::Filename);
assert_eq!(Mode::Youtube.as_str(), "youtube");
assert_eq!("filename".parse::<Mode>(), Ok(Mode::Filename));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.
Clean
"clean" in the spec and in JSON.
Youtube
"youtube" in the spec and in JSON.
Filename
"filename" in the spec and in JSON.
Tracklist
"tracklist" in the spec and in JSON.
Implementations§
Trait Implementations§
impl Copy for Mode
Source§impl<'de> Deserialize<'de> for Mode
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Mode
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Mode, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Mode, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Forget for Mode
impl Freeze for Mode
impl Move for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
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