Skip to main content

PlayerProxy

Struct PlayerProxy 

Source
pub struct PlayerProxy<'p>(/* private fields */);
Expand description

Proxy for the org.mpris.MediaPlayer2.Player interface.

Implementations§

Source§

impl<'p> PlayerProxy<'p>

Source

pub async fn new<D>( conn: &Connection, destination: D, ) -> Result<PlayerProxy<'p>>
where D: TryInto<BusName<'p>>, D::Error: Into<Error>,

Creates a new proxy with the given destination, and the default path.

Source

pub fn builder(conn: &Connection) -> Builder<'p, Self>

Returns a customizable builder for this proxy.

Source

pub fn into_inner(self) -> Proxy<'p>

Consumes self, returning the underlying zbus::Proxy.

Source

pub fn inner(&self) -> &Proxy<'p>

The reference to the underlying zbus::Proxy.

Source

pub fn inner_mut(&mut self) -> &mut Proxy<'p>

The mutable reference to the underlying zbus::Proxy.

Source

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

Next method

Source

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

Previous method

Source

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

Pause method

Source

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

PlayPause method

Source

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

Stop method

Source

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

Play method

Source

pub async fn seek(&self, offset: MprisDuration) -> Result<()>

Seek method

Source

pub async fn set_position( &self, track_id: TrackId, position: MprisDuration, ) -> Result<()>

SetPosition method

Source

pub async fn open_uri(&self, uri: &str) -> Result<()>

OpenUri method

Source

pub async fn receive_seeked(&self) -> Result<SeekedStream>

Create a stream that receives Seeked signals.

This a convenient wrapper around zbus::Proxy::receive_signal. Seeked signal

Indicates that the track position has changed in a way that is inconsistent with the current playing state.

This signal does not need to be emitted when playback starts or when the track changes, unless the track is starting at an unexpected position. An expected position would be the last known one when going from Paused to Playing, and 0 when going from Stopped to Playing.

Source

pub async fn receive_seeked_with_args( &self, args: &[(u8, &str)], ) -> Result<SeekedStream>

Create a stream that receives Seeked signals.

This a convenient wrapper around zbus::Proxy::receive_signal_with_args. Seeked signal

Indicates that the track position has changed in a way that is inconsistent with the current playing state.

This signal does not need to be emitted when playback starts or when the track changes, unless the track is starting at an unexpected position. An expected position would be the last known one when going from Paused to Playing, and 0 when going from Stopped to Playing.

Source

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

PlaybackStatus property

Source

pub fn cached_playback_status( &self, ) -> Result<Option<<Result<PlaybackStatus> as ResultAdapter>::Ok>, <Result<PlaybackStatus> as ResultAdapter>::Err>

PlaybackStatus property Get the cached value of the PlaybackStatus property, or None if the property is not cached.

Source

pub async fn receive_playback_status_changed( &self, ) -> PropertyStream<'p, <Result<PlaybackStatus> as ResultAdapter>::Ok>

PlaybackStatus property Create a stream for the PlaybackStatus property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

LoopStatus property

Source

pub fn cached_loop_status( &self, ) -> Result<Option<<Result<LoopStatus> as ResultAdapter>::Ok>, <Result<LoopStatus> as ResultAdapter>::Err>

LoopStatus property Get the cached value of the LoopStatus property, or None if the property is not cached.

Source

pub async fn receive_loop_status_changed( &self, ) -> PropertyStream<'p, <Result<LoopStatus> as ResultAdapter>::Ok>

LoopStatus property Create a stream for the LoopStatus property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

Source

pub async fn rate(&self) -> Result<f64>

Rate property

Source

pub fn cached_rate( &self, ) -> Result<Option<<Result<f64> as ResultAdapter>::Ok>, <Result<f64> as ResultAdapter>::Err>

Rate property Get the cached value of the Rate property, or None if the property is not cached.

Source

pub async fn receive_rate_changed( &self, ) -> PropertyStream<'p, <Result<f64> as ResultAdapter>::Ok>

Rate property Create a stream for the Rate property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

pub async fn set_rate(&self, value: f64) -> Result<()>

Source

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

Shuffle property

Source

pub fn cached_shuffle( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>

Shuffle property Get the cached value of the Shuffle property, or None if the property is not cached.

Source

pub async fn receive_shuffle_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>

Shuffle property Create a stream for the Shuffle property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

Source

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

Metadata property

Source

pub fn cached_metadata( &self, ) -> Result<Option<<Result<Metadata> as ResultAdapter>::Ok>, <Result<Metadata> as ResultAdapter>::Err>

Metadata property Get the cached value of the Metadata property, or None if the property is not cached.

Source

pub async fn receive_metadata_changed( &self, ) -> PropertyStream<'p, <Result<Metadata> as ResultAdapter>::Ok>

Metadata property Create a stream for the Metadata property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

pub async fn volume(&self) -> Result<f64>

Volume property

Source

pub fn cached_volume( &self, ) -> Result<Option<<Result<f64> as ResultAdapter>::Ok>, <Result<f64> as ResultAdapter>::Err>

Volume property Get the cached value of the Volume property, or None if the property is not cached.

Source

pub async fn receive_volume_changed( &self, ) -> PropertyStream<'p, <Result<f64> as ResultAdapter>::Ok>

Volume property Create a stream for the Volume property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

pub async fn set_volume(&self, value: f64) -> Result<()>

Source

pub async fn position(&self) -> Result<MprisDuration>

Position property

Source

pub async fn minimum_rate(&self) -> Result<f64>

MinimumRate property

Source

pub fn cached_minimum_rate( &self, ) -> Result<Option<<Result<f64> as ResultAdapter>::Ok>, <Result<f64> as ResultAdapter>::Err>

MinimumRate property Get the cached value of the MinimumRate property, or None if the property is not cached.

Source

pub async fn receive_minimum_rate_changed( &self, ) -> PropertyStream<'p, <Result<f64> as ResultAdapter>::Ok>

MinimumRate property Create a stream for the MinimumRate property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

pub async fn maximum_rate(&self) -> Result<f64>

MaximumRate property

Source

pub fn cached_maximum_rate( &self, ) -> Result<Option<<Result<f64> as ResultAdapter>::Ok>, <Result<f64> as ResultAdapter>::Err>

MaximumRate property Get the cached value of the MaximumRate property, or None if the property is not cached.

Source

pub async fn receive_maximum_rate_changed( &self, ) -> PropertyStream<'p, <Result<f64> as ResultAdapter>::Ok>

MaximumRate property Create a stream for the MaximumRate property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

CanGoNext property

Source

pub fn cached_can_go_next( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>

CanGoNext property Get the cached value of the CanGoNext property, or None if the property is not cached.

Source

pub async fn receive_can_go_next_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>

CanGoNext property Create a stream for the CanGoNext property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

CanGoPrevious property

Source

pub fn cached_can_go_previous( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>

CanGoPrevious property Get the cached value of the CanGoPrevious property, or None if the property is not cached.

Source

pub async fn receive_can_go_previous_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>

CanGoPrevious property Create a stream for the CanGoPrevious property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

CanPlay property

Source

pub fn cached_can_play( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>

CanPlay property Get the cached value of the CanPlay property, or None if the property is not cached.

Source

pub async fn receive_can_play_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>

CanPlay property Create a stream for the CanPlay property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

CanPause property

Source

pub fn cached_can_pause( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>

CanPause property Get the cached value of the CanPause property, or None if the property is not cached.

Source

pub async fn receive_can_pause_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>

CanPause property Create a stream for the CanPause property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

CanSeek property

Source

pub fn cached_can_seek( &self, ) -> Result<Option<<Result<bool> as ResultAdapter>::Ok>, <Result<bool> as ResultAdapter>::Err>

CanSeek property Get the cached value of the CanSeek property, or None if the property is not cached.

Source

pub async fn receive_can_seek_changed( &self, ) -> PropertyStream<'p, <Result<bool> as ResultAdapter>::Ok>

CanSeek property Create a stream for the CanSeek property changes. This is a convenient wrapper around zbus::Proxy::receive_property_changed.

Source

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

CanControl property

Trait Implementations§

Source§

impl<'p> AsMut<Proxy<'p>> for PlayerProxy<'p>

Source§

fn as_mut(&mut self) -> &mut Proxy<'p>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<'p> AsRef<Proxy<'p>> for PlayerProxy<'p>

Source§

fn as_ref(&self) -> &Proxy<'p>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'p> Clone for PlayerProxy<'p>

Source§

fn clone(&self) -> PlayerProxy<'p>

Returns a duplicate 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<'p> Debug for PlayerProxy<'p>

Source§

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

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

impl<'a> Defaults for PlayerProxy<'a>

Source§

const INTERFACE: &'static Option<InterfaceName<'static>>

Source§

const DESTINATION: &'static Option<BusName<'static>>

Source§

const PATH: &'static Option<ObjectPath<'static>>

Source§

impl From<PlayerProxy<'static>> for Player

Source§

fn from(proxy: PlayerProxy<'static>) -> Self

Converts to this type from the input type.
Source§

impl<'p> From<Proxy<'p>> for PlayerProxy<'p>

Source§

fn from(proxy: Proxy<'p>) -> Self

Converts to this type from the input type.
Source§

impl<'p> ProxyImpl<'p> for PlayerProxy<'p>

Source§

fn builder(conn: &Connection) -> Builder<'p, Self>

Return a customizable builder for this proxy.
Source§

fn into_inner(self) -> Proxy<'p>

Consume self, returning the underlying zbus::Proxy.
Source§

fn inner(&self) -> &Proxy<'p>

The reference to the underlying zbus::Proxy.
Source§

impl<'p> Serialize for PlayerProxy<'p>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'p> Type for PlayerProxy<'p>

Source§

const SIGNATURE: &'static Signature

The signature for the implementing type, in parsed format. Read more

Auto Trait Implementations§

§

impl<'p> Freeze for PlayerProxy<'p>

§

impl<'p> !RefUnwindSafe for PlayerProxy<'p>

§

impl<'p> Send for PlayerProxy<'p>

§

impl<'p> Sync for PlayerProxy<'p>

§

impl<'p> Unpin for PlayerProxy<'p>

§

impl<'p> UnsafeUnpin for PlayerProxy<'p>

§

impl<'p> !UnwindSafe for PlayerProxy<'p>

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> DynamicType for T
where T: Type + ?Sized,

Source§

fn signature(&self) -> Signature

The type signature for self. 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 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.

Source§

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

Source§

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>,

Source§

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>,

Source§

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