[−][src]Struct gmusic::GoogleMusicApi
Methods
impl GoogleMusicApi
[src]
pub fn new(
client_id: String,
client_secret: String
) -> Result<GoogleMusicApi, Error>
[src]
client_id: String,
client_secret: String
) -> Result<GoogleMusicApi, Error>
pub fn login<H>(&self, handler: H) -> Result<(), Error> where
H: Fn(String) -> String,
[src]
H: Fn(String) -> String,
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]
&self
) -> Result<Vec<DeviceManagementInfo>, Error>
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]
fn clone(&self) -> GoogleMusicApi
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GoogleMusicApi
[src]
Auto Trait Implementations
impl RefUnwindSafe for GoogleMusicApi
impl Send for GoogleMusicApi
impl Sync for GoogleMusicApi
impl Unpin for GoogleMusicApi
impl UnwindSafe for GoogleMusicApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,