[−][src]Struct rustfm_scrobble::Scrobbler
Submits song-play tracking information to Last.fm
Methods
impl Scrobbler
[src]
pub fn new(api_key: String, api_secret: String) -> Scrobbler
[src]
Creates a new Scrobbler with the given Last.fm API Key and API Secret
pub fn authenticate(
&mut self,
username: String,
password: String
) -> Result<SessionResponse, ScrobblerError>
[src]
&mut self,
username: String,
password: String
) -> Result<SessionResponse, ScrobblerError>
Use authenticate_with_password
, authenticate_with_token
or authenticate_with_session_key
Uses the given username and password (for the user to log scrobbles against), plus the API key and API secret to authenticate with Last.fm API using 'getMobileSession' authentication scheme.
pub fn authenticate_with_password(
&mut self,
username: String,
password: String
) -> Result<SessionResponse, ScrobblerError>
[src]
&mut self,
username: String,
password: String
) -> Result<SessionResponse, ScrobblerError>
pub fn authenticate_with_token(
&mut self,
token: String
) -> Result<SessionResponse, ScrobblerError>
[src]
&mut self,
token: String
) -> Result<SessionResponse, ScrobblerError>
pub fn authenticate_with_session_key(&mut self, session_key: String)
[src]
pub fn now_playing(
&self,
scrobble: Scrobble
) -> Result<NowPlayingResponse, ScrobblerError>
[src]
&self,
scrobble: Scrobble
) -> Result<NowPlayingResponse, ScrobblerError>
Registers the given track by the given artist as the currently authenticated user's "now playing" track.
pub fn scrobble(
&self,
scrobble: Scrobble
) -> Result<ScrobbleResponse, ScrobblerError>
[src]
&self,
scrobble: Scrobble
) -> Result<ScrobbleResponse, ScrobblerError>
Registers a scrobble (play) of the track with the given title by the given artist in the account of the currently authenticated user at the current time.
pub fn scrobble_batch(
&self,
batch: ScrobbleBatch
) -> Result<BatchScrobbleResponse, ScrobblerError>
[src]
&self,
batch: ScrobbleBatch
) -> Result<BatchScrobbleResponse, ScrobblerError>
pub fn session_key(&self) -> Option<String>
[src]
Gets the session key the client is currently authenticated with. Returns
None
if not authenticated. Valid session keys can be stored and used
to authenticate with authenticate_with_session_key
.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Erased for T
impl<T, U> TryInto for T where
U: TryFrom<T>,
U: TryFrom<T>,