#[non_exhaustive]pub struct FormatOptions {
pub feat: FeatPlacement,
pub feat_marker: Option<String>,
pub joiners: JoinerStyle,
pub versions: VersionsOption,
pub producers: bool,
pub position: bool,
pub label: bool,
}Expand description
Options of format_track_with (R11).
use trackparse::{format_track_with, parse, FeatPlacement, FormatOptions};
let track = parse("03. Sub Focus - Out the Blue ft. Alice Gold (Wilkinson Remix)");
let options = FormatOptions::new()
.feat(FeatPlacement::Artist)
.feat_marker("feat.")
.position(true);
assert_eq!(
format_track_with(&track, &options),
"03. Sub Focus feat. Alice Gold - Out the Blue (Wilkinson Remix)"
);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.feat: FeatPlacementWhere featured artists go; default FeatPlacement::Source (where they were found).
feat_marker: Option<String>Marker written in front of featured lists instead of the one in the input.
joiners: JoinerStyleJoiners as written or canonical; default JoinerStyle::Original.
versions: VersionsOptionWrite the versions or not; default VersionsOption::All.
producers: boolWrite prod. credits; default true.
position: boolWrite the position in front; default false.
label: boolWrite " • " + label after the title part (R11.3); default true.
Implementations§
Source§impl FormatOptions
impl FormatOptions
Sourcepub fn feat(self, feat: FeatPlacement) -> Self
pub fn feat(self, feat: FeatPlacement) -> Self
Set where featured artists go.
Sourcepub fn feat_marker(self, marker: impl Into<String>) -> Self
pub fn feat_marker(self, marker: impl Into<String>) -> Self
Set the marker written in front of featured lists.
Sourcepub fn joiners(self, joiners: JoinerStyle) -> Self
pub fn joiners(self, joiners: JoinerStyle) -> Self
Set the joiner style.
Sourcepub fn versions(self, versions: VersionsOption) -> Self
pub fn versions(self, versions: VersionsOption) -> Self
Set whether versions are written.
Trait Implementations§
Source§impl Clone for FormatOptions
impl Clone for FormatOptions
Source§impl Debug for FormatOptions
impl Debug for FormatOptions
Source§impl Default for FormatOptions
impl Default for FormatOptions
Source§impl<'de> Deserialize<'de> for FormatOptionswhere
FormatOptions: Default,
Available on crate feature serde only.
impl<'de> Deserialize<'de> for FormatOptionswhere
FormatOptions: 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 FormatOptions
Source§impl Hash for FormatOptions
impl Hash for FormatOptions
Source§impl PartialEq for FormatOptions
impl PartialEq for FormatOptions
Source§impl Serialize for FormatOptions
Available on crate feature serde only.
impl Serialize for FormatOptions
Available on crate feature
serde only.impl StructuralPartialEq for FormatOptions
Auto Trait Implementations§
impl Forget for FormatOptions
impl Freeze for FormatOptions
impl Move for FormatOptions
impl RefUnwindSafe for FormatOptions
impl Send for FormatOptionswhere
RawVecInner: Send,
impl Sync for FormatOptionswhere
RawVecInner: Sync,
impl Unpin for FormatOptions
impl UnsafeUnpin for FormatOptions
impl UnwindSafe for FormatOptionswhere
RawVecInner: UnwindSafe,
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