Struct spotify::Spotify
[−]
[src]
pub struct Spotify { /* fields omitted */ }
The Spotify API.
Methods
impl Spotify
[src]
Implements Spotify
.
fn connect() -> Result<Spotify, SpotifyError>
Connects to the local Spotify client.
fn poll<'a, F: 'static>(self, f: F) -> JoinHandle<()> where
F: Fn(&Spotify, SpotifyStatus, SpotifyStatusChange) -> bool,
F: Send,
F: Fn(&Spotify, SpotifyStatus, SpotifyStatusChange) -> bool,
F: Send,
Moves self
to a new thread and begins polling the
client status. Sends the updated status to the specified
closure, together with information of which fields had changed
since the last update. Returns the JoinHandle
of the new thread.
fn status(&self) -> Result<SpotifyStatus, SpotifyError>
Fetches the current status from the client.
fn play(&self, track: String, queue: bool) -> bool
Optionally plays a track or adds it to the queue.
fn pause(&self) -> bool
Pauses the currently playing track. Has no effect if the track is already paused.
fn resume(&self) -> bool
Resumes the currently paused track. Has no effect if the track is already playing.