pub struct Artwork { /* private fields */ }Expand description
An MPMediaItemArtwork instance backed by an image loaded from disk.
Create via Artwork::from_path or Artwork::from_path_with_size and
pass to crate::NowPlayingInfoCenter::set_now_playing_info_with_artwork.
Releasing this value releases the underlying Swift/ObjC object.
Implementations§
Source§impl Artwork
impl Artwork
Sourcepub fn from_path(path: &str) -> Result<Self, MediaPlayerError>
pub fn from_path(path: &str) -> Result<Self, MediaPlayerError>
Load an image from path and wrap it in an MPMediaItemArtwork.
The bounds size is taken from the image’s natural dimensions.
§Errors
Returns MediaPlayerError::Framework if the file cannot be read or
MPMediaItemArtwork is unavailable.
Sourcepub fn from_path_with_size(
path: &str,
bounds_size: CGSize,
) -> Result<Self, MediaPlayerError>
pub fn from_path_with_size( path: &str, bounds_size: CGSize, ) -> Result<Self, MediaPlayerError>
Load an image from path with an explicit bounds_size hint.
§Errors
Returns MediaPlayerError::Framework on failure.
Trait Implementations§
impl Send for Artwork
impl Sync for Artwork
Auto Trait Implementations§
impl Freeze for Artwork
impl RefUnwindSafe for Artwork
impl Unpin for Artwork
impl UnsafeUnpin for Artwork
impl UnwindSafe for Artwork
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