Enum itunes_com::wrappers::PossibleIITObject
source · pub enum PossibleIITObject {
Source(Source),
Playlist(Playlist),
Track(Track),
}Expand description
Enum of all structs that implement IITObjectWrapper
Variants§
Implementations§
source§impl PossibleIITObject
impl PossibleIITObject
pub fn as_source(&self) -> Option<&Source>
pub fn as_playlist(&self) -> Option<&Playlist>
sourcepub fn as_track(&self) -> Option<&Track>
pub fn as_track(&self) -> Option<&Track>
Examples found in repository?
examples/wrappers.rs (line 69)
60 61 62 63 64 65 66 67 68 69 70 71 72
fn test_unique_ids(iTunes: &itunes_com::wrappers::iTunes) -> windows::core::Result<()> {
let library_playlist = iTunes.LibraryPlaylist()?;
let first_track = library_playlist.Tracks()?.ItemByPlayOrder(1)?;
println!("First track is {}", first_track.Name()?);
let ids = first_track.GetITObjectIDs()?;
println!(" IDs = {:?}", ids);
let retrieved = iTunes.GetITObjectByID(ids)?;
println!(" OK: {:?}", retrieved.as_track().map(|t| t.Name()));
Ok(())
}