pub struct ApiRecentTracksIterator<C: LastFmApiClient> { /* private fields */ }Expand description
Iterator for browsing a user’s recent tracks via the Last.fm JSON API.
This iterator uses the user.getRecentTracks API endpoint which supports
up to 200 items per page and is less aggressively rate-limited than web scraping.
It supports optional timestamp-based filtering identical to RecentTracksIterator.
Implementations§
Source§impl<C: LastFmApiClient> ApiRecentTracksIterator<C>
impl<C: LastFmApiClient> ApiRecentTracksIterator<C>
pub fn new(client: C) -> Self
pub fn with_starting_page(client: C, starting_page: u32) -> Self
Sourcepub fn with_range(client: C, from: Option<u64>, to: Option<u64>) -> Self
pub fn with_range(client: C, from: Option<u64>, to: Option<u64>) -> Self
Create an iterator restricted to a unix-timestamp window.
from and to are forwarded to the user.getRecentTracks endpoint’s optional
query parameters on every page fetch. Per the last.fm API documentation, from
selects tracks strictly after the given timestamp and to selects tracks
strictly before it — but the exact edge inclusivity has not yet been confirmed
against the live service (to be verified via VCR recording). A caller wanting a
half-open [from, to) window should conservatively pass
from = window.start - 1, or dedupe results by timestamp.