pub struct MusicLibrary {
pub playlists: Vec<Arc<Playlist>>,
pub tracks: Vec<Arc<Track>>,
pub albums: Vec<Arc<Album>>,
pub artists: Vec<Arc<Artist>>,
pub genres: Vec<Arc<Genre>>,
/* private fields */
}Fields§
§playlists: Vec<Arc<Playlist>>§tracks: Vec<Arc<Track>>§albums: Vec<Arc<Album>>§artists: Vec<Arc<Artist>>§genres: Vec<Arc<Genre>>Implementations§
Source§impl MusicLibrary
impl MusicLibrary
pub fn find_track_by_path(&self, path: &Path) -> Option<Arc<Track>>
pub fn find_artist(&self, name: &str) -> Option<&Arc<Artist>>
pub fn find_playlist_by_name(&self, name: &str) -> Option<&Arc<Playlist>>
pub fn find_playlist_by_id(&self, id: u64) -> Option<&Arc<Playlist>>
pub fn find_album(&self, title: &str) -> Option<&Arc<Album>>
pub fn find_genre(&self, name: &str) -> Option<&Arc<Genre>>
Sourcepub fn get_default_playlist_name(&self) -> String
pub fn get_default_playlist_name(&self) -> String
Returns the default playlist name (“New Playlist”).
If a playlist with the default name exists, then a number will be added to the end of the playlist name so it’s unique, eg. “New Playlist 1”, “New Playlist 2”, etc.
Sourcepub fn tracks_from_hashes(&self, hashes: Vec<u64>) -> HashMatchingResult
pub fn tracks_from_hashes(&self, hashes: Vec<u64>) -> HashMatchingResult
Retrieves tracks corresponding to a list of provided hashes.
pub fn remove_playlists(&mut self, playlists: Vec<String>) -> Result<(), Error>
pub fn create_playlist( &mut self, name: String, track_paths: &Option<Vec<PathBuf>>, ) -> Result<(), Error>
pub fn rename_playlist( &mut self, source: &str, target: &str, ) -> Result<(), Error>
pub fn add_tracks( &mut self, name: &str, tracks: Vec<PathBuf>, ) -> Result<(), Error>
pub fn remove_tracks( &mut self, name: &str, tracks: Vec<usize>, ) -> Result<(), Error>
pub fn import_m3u8_playlist( &mut self, path: &PathBuf, name: Option<String>, ) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for MusicLibrary
impl Clone for MusicLibrary
Source§impl Debug for MusicLibrary
impl Debug for MusicLibrary
Source§impl PartialEq for MusicLibrary
impl PartialEq for MusicLibrary
impl StructuralPartialEq for MusicLibrary
Auto Trait Implementations§
impl Freeze for MusicLibrary
impl RefUnwindSafe for MusicLibrary
impl Send for MusicLibrary
impl Sync for MusicLibrary
impl Unpin for MusicLibrary
impl UnsafeUnpin for MusicLibrary
impl UnwindSafe for MusicLibrary
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more