pub struct AllCardsRequest { /* private fields */ }Expand description
Request Object to be used to execute requests to the API
Implementations§
Source§impl AllCardsRequest
impl AllCardsRequest
Sourcepub async fn next_page(&mut self) -> Result<ApiResponse<Vec<CardDetail>>, Error>
pub async fn next_page(&mut self) -> Result<ApiResponse<Vec<CardDetail>>, Error>
Executes the call to the API. Repeated calls to this method will return the different pages of the cards API
let sdk = MtgClient::new(60);
let mut get_cards_request = sdk.cards().all();
let mut cards = Vec::new();
loop {
let response = get_cards_request.next_page().await?;
if response.content.is_empty() {break}
cards.extend(response.content);
}§Errors
If this function can’t connect to the API or does not manage to read the response, it will return an error.
Sourcepub fn order_by(&mut self, field: CardResponseField)
pub fn order_by(&mut self, field: CardResponseField)
Sets the ordering of the cards
Sourcepub fn set_page_size(&mut self, size: u32)
pub fn set_page_size(&mut self, size: u32)
Sets the page size for the following API calls
Auto Trait Implementations§
impl Freeze for AllCardsRequest
impl !RefUnwindSafe for AllCardsRequest
impl !Send for AllCardsRequest
impl !Sync for AllCardsRequest
impl Unpin for AllCardsRequest
impl !UnwindSafe for AllCardsRequest
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
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> 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>
Converts
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>
Converts
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