Controller

Trait Controller 

Source
pub trait Controller {
    // Required method
    fn is_info_some(&self) -> bool;

    // Provided methods
    fn toggle(&self) -> bool { ... }
    fn play(&self) -> bool { ... }
    fn pause(&self) -> bool { ... }
    fn next(&self) -> bool { ... }
    fn previous(&self) -> bool { ... }
}

Required Methods§

Provided Methods§

Source

fn toggle(&self) -> bool

Toggles between play and pause states.

§Returns
  • true if the command was successfully sent.
  • false if the command failed.
§Example
use media_remote::prelude::*;

let now_playing = NowPlaying::new();
now_playing.toggle();
Source

fn play(&self) -> bool

Play the currently playing media.

§Returns
  • true if the command was successfully sent.
  • false if the operation failed.
§Example
use media_remote::prelude::*;

let now_playing = NowPlaying::new();
now_playing.play();
Source

fn pause(&self) -> bool

Pauses the currently playing media.

§Returns
  • true if the command was successfully sent.
  • false if the command failed.
§Example
use media_remote::prelude::*;

let now_playing = NowPlaying::new();
now_playing.pause();
Source

fn next(&self) -> bool

Skips to the next track in the playback queue.

§Returns
  • true if the command was successfully sent.
  • false if the command failed.
§Example
use media_remote::prelude::*;

let now_playing = NowPlaying::new();
now_playing.next();
Source

fn previous(&self) -> bool

Returns to the previous track in the playback queue.

§Returns
  • true if the command was successfully sent.
  • false if the command failed.
§Example
use media_remote::prelude::*;

let now_playing = NowPlaying::new();
now_playing.previous();

Implementors§