pub struct Song {
pub artist: Option<String>,
pub title: String,
pub mp3: Option<String>,
pub video: Option<String>,
pub edition: Option<String>,
pub genre: Option<String>,
pub year: Option<String>,
pub language: Option<String>,
pub bpm: f32,
pub gap: u32,
pub video_gap: Option<u32>,
pub notes: Vec<Note>,
}
Expand description
Song information
Fields§
§artist: Option<String>
§title: String
§mp3: Option<String>
Path to the audio file
video: Option<String>
§edition: Option<String>
§genre: Option<String>
§year: Option<String>
§language: Option<String>
§bpm: f32
Beats per minute
gap: u32
Delay in ms before the lyrics start after song
video_gap: Option<u32>
§notes: Vec<Note>
All notes with lyrics
Implementations§
Trait Implementations§
Source§impl FromStr for Song
impl FromStr for Song
Source§impl TryFrom<String> for Song
impl TryFrom<String> for Song
Source§fn try_from(value: String) -> Result<Self, Self::Error>
fn try_from(value: String) -> Result<Self, Self::Error>
use usdx_parser::Song;
use anyhow::Result;
let text = r#"
#ARTIST:Three Days Grace
#TITLE:I Hate Everything About You
#MP3:i_hate_everything_about_you.ogg
#LANGUAGE:English
#BPM:100
#GAP:100
"#;
let song: Result<Song> = text.to_string().try_into();
assert!(song.is_ok());
Auto Trait Implementations§
impl Freeze for Song
impl RefUnwindSafe for Song
impl Send for Song
impl Sync for Song
impl Unpin for Song
impl UnwindSafe for Song
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