pub struct Mpris {
pub port: u16,
pub state: RwLock<StateAudio>,
/* private fields */
}Fields§
§port: u16§state: RwLock<StateAudio>Implementations§
Source§impl Mpris
impl Mpris
Sourcepub async fn daemon(&self) -> RwLockReadGuard<'_, Option<MusicPlayerClient>>
pub async fn daemon(&self) -> RwLockReadGuard<'_, Option<MusicPlayerClient>>
Give access to the inner Daemon client (checks if the daemon is connected first).
Sourcepub fn new_with_daemon(daemon: MusicPlayerClient) -> Self
pub fn new_with_daemon(daemon: MusicPlayerClient) -> Self
Create a new Mpris instance with a daemon already connected.
Sourcepub async fn connect_with_retry(&self) -> Result<()>
pub async fn connect_with_retry(&self) -> Result<()>
Connect to the daemon if not already connected.
§Errors
Returns an error if the daemon cannot be connected after 5 retries.
Trait Implementations§
Source§impl PlayerInterface for Mpris
impl PlayerInterface for Mpris
Source§async fn previous(&self) -> Result<()>
async fn previous(&self) -> Result<()>
Skips to the previous track in the tracklist. Read more
Source§async fn open_uri(&self, uri: String) -> Result<()>
async fn open_uri(&self, uri: String) -> Result<()>
Opens the
uri given as an argument Read moreSource§async fn playback_status(&self) -> Result<PlaybackStatus>
async fn playback_status(&self) -> Result<PlaybackStatus>
The current playback status. Read more
Source§async fn loop_status(&self) -> Result<LoopStatus>
async fn loop_status(&self) -> Result<LoopStatus>
The current loop / repeat status Read more
Source§async fn set_loop_status(
&self,
loop_status: LoopStatus,
) -> Result<(), ZbusError>
async fn set_loop_status( &self, loop_status: LoopStatus, ) -> Result<(), ZbusError>
Sets the current loop / repeat status Read more
Source§async fn set_rate(&self, _: PlaybackRate) -> Result<(), ZbusError>
async fn set_rate(&self, _: PlaybackRate) -> Result<(), ZbusError>
Sets the current playback rate. Read more
Source§async fn set_shuffle(&self, shuffle: bool) -> Result<(), ZbusError>
async fn set_shuffle(&self, shuffle: bool) -> Result<(), ZbusError>
Sets whether playback is shuffled. Read more
Source§async fn set_volume(&self, volume: Volume) -> Result<(), ZbusError>
async fn set_volume(&self, volume: Volume) -> Result<(), ZbusError>
Sets the volume level. Read more
Source§async fn position(&self) -> Result<Time>
async fn position(&self) -> Result<Time>
The current track position, between 0 and the
mpris:length
metadata entry. Read moreSource§async fn seek(&self, offset: Time) -> Result<()>
async fn seek(&self, offset: Time) -> Result<()>
Seeks forward in the current track by the specified offset in time. Read more
Source§async fn set_position(&self, track_id: TrackId, position: Time) -> Result<()>
async fn set_position(&self, track_id: TrackId, position: Time) -> Result<()>
Sets the current track position. Read more
Source§async fn minimum_rate(&self) -> Result<PlaybackRate>
async fn minimum_rate(&self) -> Result<PlaybackRate>
Source§async fn maximum_rate(&self) -> Result<PlaybackRate>
async fn maximum_rate(&self) -> Result<PlaybackRate>
Source§async fn can_go_next(&self) -> Result<bool>
async fn can_go_next(&self) -> Result<bool>
Source§async fn can_go_previous(&self) -> Result<bool>
async fn can_go_previous(&self) -> Result<bool>
Source§impl RootInterface for Mpris
impl RootInterface for Mpris
Source§async fn raise(&self) -> Result<()>
async fn raise(&self) -> Result<()>
Brings the media player’s user interface to the front using any
appropriate mechanism available. Read more
Source§async fn fullscreen(&self) -> Result<bool>
async fn fullscreen(&self) -> Result<bool>
Whether the media player is occupying the fullscreen. Read more
Source§async fn set_fullscreen(&self, _: bool) -> Result<(), ZbusError>
async fn set_fullscreen(&self, _: bool) -> Result<(), ZbusError>
Sets whether the media player is occupying the fullscreen. Read more
Source§async fn can_set_fullscreen(&self) -> Result<bool>
async fn can_set_fullscreen(&self) -> Result<bool>
Whether the player may be asked to enter or leave fullscreen. Read more
Source§async fn can_raise(&self) -> Result<bool>
async fn can_raise(&self) -> Result<bool>
Whether the media player may be asked to be raised. Read more
Source§async fn has_track_list(&self) -> Result<bool>
async fn has_track_list(&self) -> Result<bool>
Source§async fn identity(&self) -> Result<String>
async fn identity(&self) -> Result<String>
A friendly name to identify the media player to users (eg: “VLC media
player”). Read more
Source§async fn desktop_entry(&self) -> Result<String>
async fn desktop_entry(&self) -> Result<String>
The basename of an installed .desktop file which complies with the
Desktop entry specification, with the “.desktop” extension stripped. Read more
Auto Trait Implementations§
impl !Freeze for Mpris
impl !RefUnwindSafe for Mpris
impl Send for Mpris
impl Sync for Mpris
impl Unpin for Mpris
impl UnwindSafe for Mpris
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more