pub enum PossibleIITObject {
    Source(Source),
    Playlist(Playlist),
    Track(Track),
}
Expand description

Enum of all structs that implement IITObjectWrapper

Variants§

§

Source(Source)

§

Playlist(Playlist)

§

Track(Track)

Implementations§

source§

impl PossibleIITObject

source

pub fn as_source(&self) -> Option<&Source>

source

pub fn as_playlist(&self) -> Option<&Playlist>

source

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(())
}

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.