pub struct MediaMetadata {
pub title: String,
pub artist: String,
pub album: String,
pub duration: Option<Duration>,
pub artwork: Option<MediaArtwork>,
}Expand description
What the platform media session shows: the lock screen, the notification, the car head unit.
Fields§
§title: String§artist: String§album: String§duration: Option<Duration>The item’s length when it is known before playback starts — from a tag,
or from a previous play. None means “ask the backend once it has
opened the item”, which is what PlaybackProgress::duration reports.
artwork: Option<MediaArtwork>Implementations§
Source§impl MediaMetadata
impl MediaMetadata
Sourcepub fn titled(title: impl Into<String>) -> MediaMetadata
pub fn titled(title: impl Into<String>) -> MediaMetadata
Metadata carrying only a title, which is what a bare file name gives.
Sourcepub fn artist(self, artist: impl Into<String>) -> MediaMetadata
pub fn artist(self, artist: impl Into<String>) -> MediaMetadata
Sets the performer.
Sourcepub fn album(self, album: impl Into<String>) -> MediaMetadata
pub fn album(self, album: impl Into<String>) -> MediaMetadata
Sets the album.
Sourcepub fn duration(self, duration: Duration) -> MediaMetadata
pub fn duration(self, duration: Duration) -> MediaMetadata
Sets the length known ahead of playback.
Sourcepub fn artwork(self, artwork: MediaArtwork) -> MediaMetadata
pub fn artwork(self, artwork: MediaArtwork) -> MediaMetadata
Sets the artwork.
Trait Implementations§
Source§impl Clone for MediaMetadata
impl Clone for MediaMetadata
Source§fn clone(&self) -> MediaMetadata
fn clone(&self) -> MediaMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MediaMetadata
impl Debug for MediaMetadata
Source§impl Default for MediaMetadata
impl Default for MediaMetadata
Source§fn default() -> MediaMetadata
fn default() -> MediaMetadata
Returns the “default value” for a type. Read more
impl Eq for MediaMetadata
Source§impl PartialEq for MediaMetadata
impl PartialEq for MediaMetadata
impl StructuralPartialEq for MediaMetadata
Auto Trait Implementations§
impl Freeze for MediaMetadata
impl RefUnwindSafe for MediaMetadata
impl Send for MediaMetadata
impl Sync for MediaMetadata
impl Unpin for MediaMetadata
impl UnsafeUnpin for MediaMetadata
impl UnwindSafe for MediaMetadata
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