Struct mpris_server::builder::MetadataBuilder

source ·
pub struct MetadataBuilder { /* private fields */ }
Expand description

A builder used to create Metadata.

Implementations§

source§

impl MetadataBuilder

source

pub fn other(self, key: &str, value: impl Into<Value<'static>>) -> Self

Sets a value for the given key.

source

pub fn trackid(self, trackid: impl Into<TrackId>) -> Self

Sets a unique identity for this track within the context of an MPRIS object (eg: tracklist).

This contains a D-Bus path that uniquely identifies the track within the scope of the playlist. There may or may not be an actual D-Bus object at that path; this specification says nothing about what interfaces such an object may implement.

source

pub fn length(self, length: Time) -> Self

Sets the duration of the track.

source

pub fn art_url(self, art_url: impl Into<Uri>) -> Self

Sets the location of an image representing the track or album.

Clients should not assume this will continue to exist when the media player stops giving out the URL.

source

pub fn album(self, album: impl Into<String>) -> Self

Sets the album name.

source

pub fn album_artist( self, album_artist: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Sets the album artist(s).

source

pub fn artist(self, artist: impl IntoIterator<Item = impl Into<String>>) -> Self

Sets the track artist(s).

source

pub fn lyrics(self, lyrics: impl Into<String>) -> Self

Sets the track lyrics.

source

pub fn audio_bpm(self, audio_bpm: i32) -> Self

Sets the speed of the music, in beats per minute.

source

pub fn auto_rating(self, auto_rating: f64) -> Self

Sets an automatically-generated rating, based on things such as how often it has been played. This should be in the range 0.0 to 1.0.

source

pub fn comment( self, comment: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Sets a (list of) freeform comment(s).

source

pub fn composer( self, composer: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Sets the composer(s) of the track.

source

pub fn content_created(self, content_created: impl Into<DateTime>) -> Self

Sets when the track was created. Usually only the year component will be useful.

source

pub fn disc_number(self, disc_number: i32) -> Self

Sets the disc number on the album that this track is from.

source

pub fn first_used(self, first_used: impl Into<DateTime>) -> Self

Sets when the track was first played.

source

pub fn genre(self, genre: impl IntoIterator<Item = impl Into<String>>) -> Self

Sets the genre(s) of the track.

source

pub fn last_used(self, last_used: impl Into<DateTime>) -> Self

Sets when the track was last played.

source

pub fn lyricist( self, lyricist: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Sets the lyricist(s) of the track.

source

pub fn title(self, title: impl Into<String>) -> Self

Sets the track title.

source

pub fn track_number(self, track_number: i32) -> Self

Sets the track number on the album disc.

source

pub fn url(self, url: impl Into<Uri>) -> Self

Sets the location of the media file.

source

pub fn use_count(self, use_count: i32) -> Self

Sets the number of times the track has been played.

source

pub fn user_rating(self, user_rating: f64) -> Self

Sets a user-specified rating. This should be in the range 0.0 to 1.0.

source

pub fn build(self) -> Metadata

Creates Metadata from the builder.

Trait Implementations§

source§

impl Clone for MetadataBuilder

source§

fn clone(&self) -> MetadataBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MetadataBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MetadataBuilder

source§

fn default() -> MetadataBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

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.

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more