pub struct Library<'a>(pub &'a Client);
Expand description
Endpoints relating to saving albums and tracks.
Tuple Fields§
§0: &'a Client
Implementations§
Source§impl Library<'_>
impl Library<'_>
Sourcepub async fn user_saved_albums<I: IntoIterator>(
self,
ids: I,
) -> Result<Response<Vec<bool>>, Error>
pub async fn user_saved_albums<I: IntoIterator>( self, ids: I, ) -> Result<Response<Vec<bool>>, Error>
Check if the current user has saved some albums.
Returns vector of bools that is in the same order as the given ids, telling whether the user
has saved each album. Requires user-library-read
.
Sourcepub async fn user_saved_shows<I: IntoIterator>(
self,
ids: I,
) -> Result<Response<Vec<bool>>, Error>
pub async fn user_saved_shows<I: IntoIterator>( self, ids: I, ) -> Result<Response<Vec<bool>>, Error>
Check if the current user has saved some shows.
Returns vector of bools that is in the same order as the given ids, telling whether the user
has saved each album. Requires user-library-read
.
Sourcepub async fn user_saved_tracks<I: IntoIterator>(
self,
ids: I,
) -> Result<Response<Vec<bool>>, Error>
pub async fn user_saved_tracks<I: IntoIterator>( self, ids: I, ) -> Result<Response<Vec<bool>>, Error>
Check if the current user has saved some tracks.
Returns vector of bools that is in the same order as the given ids, telling whether the user
has saved each track. Requires user-library-read
.
Sourcepub async fn get_saved_albums(
self,
limit: usize,
offset: usize,
market: Option<Market>,
) -> Result<Response<Page<SavedAlbum>>, Error>
pub async fn get_saved_albums( self, limit: usize, offset: usize, market: Option<Market>, ) -> Result<Response<Page<SavedAlbum>>, Error>
Get the current user’s saved albums.
Requires user-library-read
. Limit must be in the range [1..50].
Sourcepub async fn get_saved_shows(
self,
limit: usize,
offset: usize,
) -> Result<Response<Page<SavedShow>>, Error>
pub async fn get_saved_shows( self, limit: usize, offset: usize, ) -> Result<Response<Page<SavedShow>>, Error>
Get the current user’s saved shows.
Requires user-library-read
. Limit must be in the range [1..50].
Sourcepub async fn get_saved_tracks(
self,
limit: usize,
offset: usize,
market: Option<Market>,
) -> Result<Response<Page<SavedTrack>>, Error>
pub async fn get_saved_tracks( self, limit: usize, offset: usize, market: Option<Market>, ) -> Result<Response<Page<SavedTrack>>, Error>
Get the current user’s saved tracks.
Requires user-library-read
. Limit must be in the range [1..50].
Sourcepub async fn unsave_albums<I: IntoIterator>(self, ids: I) -> Result<(), Error>
pub async fn unsave_albums<I: IntoIterator>(self, ids: I) -> Result<(), Error>
Sourcepub async fn unsave_shows<I: IntoIterator>(self, ids: I) -> Result<(), Error>
pub async fn unsave_shows<I: IntoIterator>(self, ids: I) -> Result<(), Error>
Sourcepub async fn unsave_tracks<I: IntoIterator>(self, ids: I) -> Result<(), Error>
pub async fn unsave_tracks<I: IntoIterator>(self, ids: I) -> Result<(), Error>
Sourcepub async fn save_albums<I: IntoIterator>(self, ids: I) -> Result<(), Error>
pub async fn save_albums<I: IntoIterator>(self, ids: I) -> Result<(), Error>
Sourcepub async fn save_shows<I: IntoIterator>(self, ids: I) -> Result<(), Error>
pub async fn save_shows<I: IntoIterator>(self, ids: I) -> Result<(), Error>
Sourcepub async fn save_tracks<I: IntoIterator>(self, ids: I) -> Result<(), Error>
pub async fn save_tracks<I: IntoIterator>(self, ids: I) -> Result<(), Error>
Trait Implementations§
impl<'a> Copy for Library<'a>
Auto Trait Implementations§
impl<'a> Freeze for Library<'a>
impl<'a> !RefUnwindSafe for Library<'a>
impl<'a> Send for Library<'a>
impl<'a> Sync for Library<'a>
impl<'a> Unpin for Library<'a>
impl<'a> !UnwindSafe for Library<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more