[−][src]Struct melody::Song
Song struct
Fields
artist: Option<String>
Artist of the song
album: Option<String>
Album of the song
title: Option<String>
Title of the song
track: Option<u32>
Track of the song
duration: Duration
Duration of the song
genre: Option<String>
Genre of the song
file: PathBuf
File path to the song
status: Status
Elapsed time of song playing or Start time
Methods
impl Song
[src]
pub fn artist(&self) -> Option<&str>
[src]
Optionally return the artist of the song
If None
it wasn't able to read the tags
pub fn album(&self) -> Option<&str>
[src]
Optionally return the song's album
If None
failed to read the tags
pub fn title(&self) -> Option<&str>
[src]
Optionally return the title of the song
If None
it wasn't able to read the tags
pub fn track(&self) -> Option<u32>
[src]
Optionally returns the song's track number
If None
it wasn't able to read the tags
pub fn genre(&self) -> Option<&str>
[src]
Optionally returns the song's genre
If None
it wasn't able to read the tags
pub fn duration(&self) -> Duration
[src]
Returns the Duration
of the song
pub fn elapsed(&self) -> Duration
[src]
Returns the elapsed time the song has been played
pub fn stop(&mut self)
[src]
Pause the song
pub fn resume(&mut self)
[src]
Resume the song
pub fn is_stopped(&self) -> bool
[src]
Check if the song is stopped/paused
pub fn file(&self) -> &Path
[src]
Returns the path of the song
pub fn load(file: PathBuf) -> Result<Self, MelodyErrors>
[src]
Load song from Pathbuf
pub fn matching_song(&self, s: &Song, matching_genre: bool) -> bool
[src]
Checks if the song is the same if matching_genre is true it will check genre as well
pub fn exact_match(&self, s: &Song, same_path: bool) -> bool
[src]
Checks if the song is an exact match Checks the song's tags and if the path is the same
Trait Implementations
impl Eq for Song
[src]
impl Ord for Song
[src]
fn cmp(&self, other: &Song) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialEq<Song> for Song
[src]
impl Clone for Song
[src]
fn clone(&self) -> Song
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd<Song> for Song
[src]
fn partial_cmp(&self, other: &Song) -> Option<Ordering>
[src]
fn lt(&self, other: &Song) -> bool
[src]
fn le(&self, other: &Song) -> bool
[src]
fn gt(&self, other: &Song) -> bool
[src]
fn ge(&self, other: &Song) -> bool
[src]
impl AsRef<Path> for Song
[src]
impl Debug for Song
[src]
impl Display for Song
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,