pub struct ContentItem { /* private fields */ }Expand description
Owned wrapper around MPContentItem.
Implementations§
Source§impl ContentItem
impl ContentItem
Sourcepub fn new(identifier: &str) -> Result<Self, MediaPlayerError>
pub fn new(identifier: &str) -> Result<Self, MediaPlayerError>
Create a content item with a stable identifier.
§Errors
Returns MediaPlayerError::InvalidArgument if identifier contains an
interior NUL byte, or MediaPlayerError::Framework if the framework
refuses to create the item.
pub fn identifier(&self) -> String
pub fn title(&self) -> Option<String>
Sourcepub fn set_title(&self, title: Option<&str>) -> Result<(), MediaPlayerError>
pub fn set_title(&self, title: Option<&str>) -> Result<(), MediaPlayerError>
Update the item’s title.
Pass None to clear the title.
§Errors
Returns MediaPlayerError::InvalidArgument if the string contains an
interior NUL byte.
pub fn subtitle(&self) -> Option<String>
Sourcepub fn set_subtitle(
&self,
subtitle: Option<&str>,
) -> Result<(), MediaPlayerError>
pub fn set_subtitle( &self, subtitle: Option<&str>, ) -> Result<(), MediaPlayerError>
Update the item’s subtitle.
Pass None to clear the subtitle.
§Errors
Returns MediaPlayerError::InvalidArgument if the string contains an
interior NUL byte.
pub fn artwork(&self) -> Option<Artwork>
pub fn set_artwork(&self, artwork: Option<&Artwork>)
pub fn playback_progress(&self) -> f32
pub fn set_playback_progress(&self, playback_progress: f32)
pub fn is_streaming_content(&self) -> bool
pub fn set_streaming_content(&self, streaming_content: bool)
pub fn is_explicit_content(&self) -> bool
pub fn set_explicit_content(&self, explicit_content: bool)
pub fn is_container(&self) -> bool
pub fn set_container(&self, container: bool)
pub fn is_playable(&self) -> bool
pub fn set_playable(&self, playable: bool)
Trait Implementations§
Source§impl Clone for ContentItem
impl Clone for ContentItem
Source§impl Debug for ContentItem
impl Debug for ContentItem
Source§impl Drop for ContentItem
impl Drop for ContentItem
impl Send for ContentItem
impl Sync for ContentItem
Auto Trait Implementations§
impl Freeze for ContentItem
impl RefUnwindSafe for ContentItem
impl Unpin for ContentItem
impl UnsafeUnpin for ContentItem
impl UnwindSafe for ContentItem
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