pub struct ArtistAlbumsIterator<'a> { /* private fields */ }Expand description
Iterator for browsing an artist’s albums from a user’s library.
This iterator provides paginated access to all albums by a specific artist in the authenticated user’s Last.fm library, ordered by play count.
§Examples
let mut client = LastFmEditClient::new(Box::new(http_client::native::NativeClient::new()));
// client.login(...).await?;
let mut albums = client.artist_albums("Pink Floyd");
// Get all albums (be careful with large discographies!)
while let Some(album) = albums.next().await? {
println!("{} (played {} times)", album.name, album.playcount);
}Implementations§
Source§impl<'a> ArtistAlbumsIterator<'a>
impl<'a> ArtistAlbumsIterator<'a>
Sourcepub fn new(client: &'a LastFmEditClient, artist: String) -> Self
pub fn new(client: &'a LastFmEditClient, artist: String) -> Self
Create a new artist albums iterator.
This is typically called via LastFmEditClient::artist_albums.
Sourcepub async fn next_page(&mut self) -> Result<Option<AlbumPage>>
pub async fn next_page(&mut self) -> Result<Option<AlbumPage>>
Fetch the next page of albums.
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<'a> AsyncPaginatedIterator for ArtistAlbumsIterator<'a>
impl<'a> AsyncPaginatedIterator for ArtistAlbumsIterator<'a>
Source§async fn next(&mut self) -> Result<Option<Self::Item>>
async fn next(&mut self) -> Result<Option<Self::Item>>
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<'a> Freeze for ArtistAlbumsIterator<'a>
impl<'a> !RefUnwindSafe for ArtistAlbumsIterator<'a>
impl<'a> Send for ArtistAlbumsIterator<'a>
impl<'a> Sync for ArtistAlbumsIterator<'a>
impl<'a> Unpin for ArtistAlbumsIterator<'a>
impl<'a> !UnwindSafe for ArtistAlbumsIterator<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more