Struct itunes_com::wrappers::PlaylistCollection
source · pub struct PlaylistCollection { /* private fields */ }Expand description
Safe wrapper over a IITPlaylistCollection
Implementations§
source§impl PlaylistCollection
impl PlaylistCollection
sourcepub fn ItemByName(&self, name: String) -> Result<Playlist>
pub fn ItemByName(&self, name: String) -> Result<Playlist>
Returns an IITPlaylist object with the specified name.
sourcepub fn ItemByPersistentID(&self, id: u64) -> Result<Playlist>
pub fn ItemByPersistentID(&self, id: u64) -> Result<Playlist>
Returns an IITPlaylist object with the specified persistent ID.
source§impl PlaylistCollection
impl PlaylistCollection
sourcepub fn iter(&self) -> Result<Iterator<'_, PlaylistCollection, Playlist>>
pub fn iter(&self) -> Result<Iterator<'_, PlaylistCollection, Playlist>>
Examples found in repository?
examples/wrappers.rs (line 31)
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
fn show_playlists(iTunes: &itunes_com::wrappers::iTunes) -> windows::core::Result<()> {
let sources = iTunes.Sources()?;
for source in sources.iter()? {
let kind = source.Kind()?;
println!("Source kind: {:?}", kind);
if kind == ITSourceKind::ITSourceKindLibrary {
for pl in source.Playlists()?.iter()? {
let pl_kind = pl.Kind()?;
let tracks = pl.Tracks()?;
let track_count = tracks.iter()?.len();
let first_track = tracks.ItemByPlayOrder(1);
let first_track_name = first_track.and_then(|t| t.Name()).unwrap_or(String::from("<no track>"));
println!(" * {}\t{:?}: {} tracks (first one is {})", pl.Name()?, pl_kind, track_count, first_track_name);
}
}
}
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for PlaylistCollection
impl !Send for PlaylistCollection
impl !Sync for PlaylistCollection
impl Unpin for PlaylistCollection
impl UnwindSafe for PlaylistCollection
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