[][src]Struct rustfm_scrobble::Scrobbler

pub struct Scrobbler { /* fields omitted */ }

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]

Deprecated since 0.9.1:

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]

pub fn authenticate_with_token(
    &mut self,
    token: String
) -> Result<SessionResponse, ScrobblerError>
[src]

pub fn authenticate_with_session_key(&mut self, session_key: String)[src]

pub fn now_playing(
    &self,
    scrobble: Scrobble
) -> Result<NowPlayingResponse, ScrobblerError>
[src]

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]

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]

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

impl Send for Scrobbler

impl Sync for Scrobbler

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Erased for T

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

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