#[non_exhaustive]pub struct KeywordOptions {
pub version_heads: Vec<(String, VersionType)>,
pub descriptors: Vec<String>,
pub genres: Vec<String>,
pub junk: Vec<(String, JunkKind)>,
pub feat_markers: Vec<String>,
}Expand description
Extra vocabulary, added to the built-in word lists (R12). Keys are matched with ASCII lowercasing.
use trackparse::{parse_with, JunkKind, KeywordOptions, ParseOptions, VersionType};
let keywords = KeywordOptions::new()
.version_head("rerub", VersionType::Remix)
.junk("out now", JunkKind::Promo);
let options = ParseOptions::new().keywords(keywords);
let track = parse_with("Noisia - Stigma (Phace Rerub) [Out Now]", &options);
assert_eq!(track.versions[0].version_type, VersionType::Remix);
assert_eq!(track.versions[0].artists[0].name, "Phace");
assert_eq!(track.junk[0].kind, JunkKind::Promo);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version_heads: Vec<(String, VersionType)>Extra version heads: word and the version type it means. A JSON object (versionHeads).
descriptors: Vec<String>Extra descriptor words (Extended, Deluxe).
genres: Vec<String>Extra genre names.
junk: Vec<(String, JunkKind)>Extra junk phrases: phrase and its kind. A JSON object.
feat_markers: Vec<String>Extra markers that introduce featured artists (featMarkers in JSON).
Implementations§
Source§impl KeywordOptions
impl KeywordOptions
Sourcepub fn version_head(
self,
key: impl Into<String>,
version_type: VersionType,
) -> Self
pub fn version_head( self, key: impl Into<String>, version_type: VersionType, ) -> Self
Add a version head ("rerub" means VersionType::Remix).
Sourcepub fn descriptor(self, word: impl Into<String>) -> Self
pub fn descriptor(self, word: impl Into<String>) -> Self
Add a descriptor word.
Sourcepub fn junk(self, phrase: impl Into<String>, kind: JunkKind) -> Self
pub fn junk(self, phrase: impl Into<String>, kind: JunkKind) -> Self
Add a junk phrase ("free download" is JunkKind::Promo).
Sourcepub fn feat_marker(self, marker: impl Into<String>) -> Self
pub fn feat_marker(self, marker: impl Into<String>) -> Self
Add a marker that introduces featured artists.
Trait Implementations§
Source§impl Clone for KeywordOptions
impl Clone for KeywordOptions
Source§impl Debug for KeywordOptions
impl Debug for KeywordOptions
Source§impl Default for KeywordOptions
impl Default for KeywordOptions
Source§impl<'de> Deserialize<'de> for KeywordOptionswhere
KeywordOptions: Default,
Available on crate feature serde only.
impl<'de> Deserialize<'de> for KeywordOptionswhere
KeywordOptions: Default,
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 KeywordOptions
Source§impl Hash for KeywordOptions
impl Hash for KeywordOptions
Source§impl PartialEq for KeywordOptions
impl PartialEq for KeywordOptions
Source§impl Serialize for KeywordOptions
Available on crate feature serde only.
impl Serialize for KeywordOptions
Available on crate feature
serde only.impl StructuralPartialEq for KeywordOptions
Auto Trait Implementations§
impl Forget for KeywordOptions
impl Freeze for KeywordOptions
impl Move for KeywordOptions
impl RefUnwindSafe for KeywordOptions
impl Send for KeywordOptions
impl Sync for KeywordOptions
impl Unpin for KeywordOptions
impl UnsafeUnpin for KeywordOptions
impl UnwindSafe for KeywordOptions
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