Struct mpris_server::Player

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

Premade mutable object that internally implements RootInterface and PlayerInterface.

Implementations§

source§

impl Player

source

pub fn builder(bus_name_suffix: &str) -> PlayerBuilder

source

pub async fn run(&self) -> Result<()>

source

pub fn connect_raise(&self, cb: impl Fn() + 'static)

source

pub fn connect_quit(&self, cb: impl Fn() + 'static)

source

pub fn can_quit(&self) -> bool

source

pub async fn set_can_quit(&self, can_quit: bool) -> Result<()>

source

pub fn fullscreen(&self) -> bool

source

pub async fn set_fullscreen(&self, fullscreen: bool) -> Result<()>

source

pub fn can_set_fullscreen(&self) -> bool

source

pub async fn set_can_set_fullscreen( &self, can_set_fullscreen: bool ) -> Result<()>

source

pub fn can_raise(&self) -> bool

source

pub async fn set_can_raise(&self, can_raise: bool) -> Result<()>

source

pub fn has_track_list(&self) -> bool

source

pub async fn set_has_track_list(&self, has_track_list: bool) -> Result<()>

source

pub fn identity(&self) -> Ref<'_, String>

source

pub async fn set_identity(&self, identity: impl Into<String>) -> Result<()>

source

pub fn desktop_entry(&self) -> Ref<'_, String>

source

pub async fn set_desktop_entry( &self, desktop_entry: impl Into<String> ) -> Result<()>

source

pub fn supported_uri_schemes(&self) -> Ref<'_, Vec<String>>

source

pub async fn set_supported_uri_schemes( &self, supported_uri_schemes: impl IntoIterator<Item = impl Into<String>> ) -> Result<()>

source

pub fn supported_mime_types(&self) -> Ref<'_, Vec<String>>

source

pub async fn set_supported_mime_types( &self, supported_mime_types: impl IntoIterator<Item = impl Into<String>> ) -> Result<()>

source

pub fn connect_next(&self, cb: impl Fn() + 'static)

source

pub fn connect_previous(&self, cb: impl Fn() + 'static)

source

pub fn connect_pause(&self, cb: impl Fn() + 'static)

source

pub fn connect_play_pause(&self, cb: impl Fn() + 'static)

source

pub fn connect_stop(&self, cb: impl Fn() + 'static)

source

pub fn connect_play(&self, cb: impl Fn() + 'static)

source

pub fn connect_seek(&self, cb: impl Fn(TimeInUs) + 'static)

source

pub fn connect_set_position(&self, cb: impl Fn(&TrackId, TimeInUs) + 'static)

source

pub fn connect_open_uri(&self, cb: impl Fn(&str) + 'static)

source

pub async fn emit_seeked(&self, position: TimeInUs) -> Result<()>

source

pub fn playback_status(&self) -> PlaybackStatus

source

pub async fn set_playback_status( &self, playback_status: PlaybackStatus ) -> Result<()>

source

pub fn loop_status(&self) -> LoopStatus

source

pub async fn set_loop_status(&self, loop_status: LoopStatus) -> Result<()>

source

pub fn rate(&self) -> PlaybackRate

source

pub async fn set_rate(&self, rate: PlaybackRate) -> Result<()>

source

pub fn shuffle(&self) -> bool

source

pub async fn set_shuffle(&self, shuffle: bool) -> Result<()>

source

pub fn metadata(&self) -> Ref<'_, Metadata>

source

pub async fn set_metadata(&self, metadata: Metadata) -> Result<()>

source

pub fn volume(&self) -> Volume

source

pub async fn set_volume(&self, volume: Volume) -> Result<()>

source

pub fn position(&self) -> TimeInUs

source

pub async fn set_position(&self, position: TimeInUs) -> Result<()>

source

pub fn minimum_rate(&self) -> PlaybackRate

source

pub async fn set_minimum_rate(&self, minimum_rate: PlaybackRate) -> Result<()>

source

pub fn maximum_rate(&self) -> PlaybackRate

source

pub async fn set_maximum_rate(&self, maximum_rate: PlaybackRate) -> Result<()>

source

pub fn can_go_next(&self) -> bool

source

pub async fn set_can_go_next(&self, can_go_next: bool) -> Result<()>

source

pub fn can_go_previous(&self) -> bool

source

pub async fn set_can_go_previous(&self, can_go_previous: bool) -> Result<()>

source

pub fn can_play(&self) -> bool

source

pub async fn set_can_play(&self, can_play: bool) -> Result<()>

source

pub fn can_pause(&self) -> bool

source

pub async fn set_can_pause(&self, can_pause: bool) -> Result<()>

source

pub fn can_seek(&self) -> bool

source

pub async fn set_can_seek(&self, can_seek: bool) -> Result<()>

source

pub fn can_control(&self) -> bool

source

pub async fn set_can_control(&self, can_control: bool) -> Result<()>

Trait Implementations§

source§

impl Debug for Player

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Player

§

impl !Send for Player

§

impl !Sync for Player

§

impl Unpin for Player

§

impl !UnwindSafe for Player

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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 Twhere 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.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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 Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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