pub struct ArtistTracksDirectIterator<C: LastFmEditClient> { /* private fields */ }Expand description
Iterator for browsing an artist’s tracks directly using the paginated artist tracks endpoint.
This iterator provides access to all tracks by a specific artist
in the authenticated user’s Last.fm library by directly using the
/user/{username}/library/music/{artist}/+tracks endpoint with pagination.
This is more efficient than the album-based approach as it doesn’t need to
iterate through albums first.
Implementations§
Source§impl<C: LastFmEditClient> ArtistTracksDirectIterator<C>
impl<C: LastFmEditClient> ArtistTracksDirectIterator<C>
Sourcepub fn new(client: C, artist: String) -> Self
pub fn new(client: C, artist: String) -> Self
Create a new direct artist tracks iterator.
This is typically called via LastFmEditClient::artist_tracks_direct.
Sourcepub async fn next_page(&mut self) -> Result<Option<TrackPage>>
pub async fn next_page(&mut self) -> Result<Option<TrackPage>>
Fetch the next page of tracks.
This method handles pagination automatically and includes rate limiting.
Sourcepub fn total_pages(&self) -> Option<u32>
pub fn total_pages(&self) -> Option<u32>
Get the total number of pages, if known.
Returns None until at least one page has been fetched.
Trait Implementations§
Source§impl<C: LastFmEditClient> AsyncPaginatedIterator<Track> for ArtistTracksDirectIterator<C>
impl<C: LastFmEditClient> AsyncPaginatedIterator<Track> for ArtistTracksDirectIterator<C>
Source§fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Track>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Track>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch the next item from the iterator. Read more
Source§fn current_page(&self) -> u32
fn current_page(&self) -> u32
Get the current page number (0-indexed). Read more
Auto Trait Implementations§
impl<C> Freeze for ArtistTracksDirectIterator<C>where
C: Freeze,
impl<C> RefUnwindSafe for ArtistTracksDirectIterator<C>where
C: RefUnwindSafe,
impl<C> Send for ArtistTracksDirectIterator<C>where
C: Send,
impl<C> Sync for ArtistTracksDirectIterator<C>where
C: Sync,
impl<C> Unpin for ArtistTracksDirectIterator<C>where
C: Unpin,
impl<C> UnwindSafe for ArtistTracksDirectIterator<C>where
C: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more