pub struct Player<'a> {
pub name: String,
/* private fields */
}
Expand description
A struct used to control an MPRIS player.
Fields
name: String
Implementations
sourceimpl<'a> Player<'a>
impl<'a> Player<'a>
sourcepub async fn try_new<T>(
name: T,
conn: &'a SyncConnection
) -> Result<Player<'a>, Box<dyn Error>> where
T: AsRef<str> + Display,
pub async fn try_new<T>(
name: T,
conn: &'a SyncConnection
) -> Result<Player<'a>, Box<dyn Error>> where
T: AsRef<str> + Display,
Tries to create a new Player
instance from a given name.
Errors
Returns an Err
if the provided player is invalid.
sourcepub async fn get_property<T>(
&mut self,
property: &str
) -> Result<T, Box<dyn Error>> where
T: for<'c> Get<'c> + 'static,
pub async fn get_property<T>(
&mut self,
property: &str
) -> Result<T, Box<dyn Error>> where
T: for<'c> Get<'c> + 'static,
sourcepub async fn set_property<T>(
&mut self,
property: &str,
value: T
) -> Result<(), Box<dyn Error>> where
T: Arg + Append,
pub async fn set_property<T>(
&mut self,
property: &str,
value: T
) -> Result<(), Box<dyn Error>> where
T: Arg + Append,
sourcepub async fn seek(&mut self, offset: Duration) -> Result<(), Box<dyn Error>>
pub async fn seek(&mut self, offset: Duration) -> Result<(), Box<dyn Error>>
Seeks the position of the active track.
sourcepub async fn seek_reverse(
&mut self,
offset: Duration
) -> Result<(), Box<dyn Error>>
pub async fn seek_reverse(
&mut self,
offset: Duration
) -> Result<(), Box<dyn Error>>
Same as seek
, but in reverse.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Player<'a>
impl<'a> Send for Player<'a>
impl<'a> Sync for Player<'a>
impl<'a> Unpin for Player<'a>
impl<'a> !UnwindSafe for Player<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more