[][src]Struct gmusic::GoogleMusicApi

pub struct GoogleMusicApi { /* fields omitted */ }

Methods

impl GoogleMusicApi[src]

pub fn new(
    client_id: String,
    client_secret: String
) -> Result<GoogleMusicApi, Error>
[src]

pub fn login<H>(&self, handler: H) -> Result<(), Error> where
    H: Fn(String) -> String
[src]

Perform an OAuth Login

Available handlers:

Example

use gmusic::{GoogleMusicApi, auth::stdio_login};

let api = GoogleMusicApi::new(String::new(), String::new()).unwrap();

api.login(stdio_login).unwrap();

pub fn store_token(&self) -> Result<(), Error>[src]

Stores the auth and refresh token in a .google-auth.json file for login without user input.

pub fn load_token(&self) -> Result<(), Error>[src]

Stores the auth and refresh token from a .google-auth.json file for login without user input.

pub fn get_all_tracks(&self) -> Result<Vec<Track>, Error>[src]

Returns a list of all user tracks

pub fn get_all_playlists(&self) -> Result<Vec<Playlist>, Error>[src]

Returns a list of all playlists a user has created or subscribed to

pub fn get_device_management_info(
    &self
) -> Result<Vec<DeviceManagementInfo>, Error>
[src]

Returns a list of the devices the user has used Google Play Music on

pub fn get_playlist_entries(&self) -> Result<Vec<PlaylistEntry>, Error>[src]

Returns the tracks used in all user created playlists

pub fn get_stream_url(&self, id: &str, device_id: &str) -> Result<Url, Error>[src]

Get a stream url for the given track id with the given device id

Valid for 1 Minute

Trait Implementations

impl Clone for GoogleMusicApi[src]

impl Debug for GoogleMusicApi[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err