#[non_exhaustive]pub enum ModeOption {
Auto,
Clean,
Youtube,
Filename,
Tracklist,
}Expand description
The mode to parse in (R2). Auto picks clean, youtube or filename from the string
itself, never tracklist.
use trackparse::{parse_with, Mode, ModeOption, ParseOptions};
let input = "Noisia - Stigma (Official Video)";
assert_eq!(parse_with(input, &ParseOptions::new()).mode, Mode::Youtube);
let clean = ParseOptions::new().mode(ModeOption::Clean);
assert_eq!(parse_with(input, &clean).mode, Mode::Clean);
assert_eq!(ModeOption::default(), ModeOption::Auto);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.
Auto
"auto" in the spec and in JSON.
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§
Source§impl ModeOption
impl ModeOption
Sourcepub const ALL: &'static [ModeOption]
pub const ALL: &'static [ModeOption]
Every value, in the spec’s order.
Sourcepub fn from_name(name: &str) -> Option<ModeOption>
pub fn from_name(name: &str) -> Option<ModeOption>
The value with that spec name (exact match), or None.
Trait Implementations§
Source§impl Clone for ModeOption
impl Clone for ModeOption
impl Copy for ModeOption
Source§impl Debug for ModeOption
impl Debug for ModeOption
Source§impl Default for ModeOption
impl Default for ModeOption
Source§impl<'de> Deserialize<'de> for ModeOption
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ModeOption
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(
deserializer: D,
) -> Result<ModeOption, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D, ) -> Result<ModeOption, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ModeOption
impl Display for ModeOption
impl Eq for ModeOption
Source§impl FromStr for ModeOption
impl FromStr for ModeOption
Source§impl Hash for ModeOption
impl Hash for ModeOption
Source§impl PartialEq for ModeOption
impl PartialEq for ModeOption
Source§impl Serialize for ModeOption
Available on crate feature serde only.
impl Serialize for ModeOption
Available on crate feature
serde only.impl StructuralPartialEq for ModeOption
Auto Trait Implementations§
impl Forget for ModeOption
impl Freeze for ModeOption
impl Move for ModeOption
impl RefUnwindSafe for ModeOption
impl Send for ModeOption
impl Sync for ModeOption
impl Unpin for ModeOption
impl UnsafeUnpin for ModeOption
impl UnwindSafe for ModeOption
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