pub struct MusicLibrary {
pub playlists: HashSet<Arc<Playlist>>,
pub tracks: HashSet<Arc<Track>>,
/* private fields */
}Fields§
§playlists: HashSet<Arc<Playlist>>§tracks: HashSet<Arc<Track>>Implementations§
Source§impl MusicLibrary
impl MusicLibrary
pub fn find_playlist(&self, name: &str) -> Option<&Arc<Playlist>>
pub fn find_track_by_path(&self, path: &Path) -> Option<Arc<Track>>
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.
pub fn tracks_from_hashes( &self, hashes: Vec<u64>, ) -> Result<Vec<Arc<Track>>, Error>
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§fn clone(&self) -> MusicLibrary
fn clone(&self) -> MusicLibrary
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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