[][src]Struct mtgapi_client::api::card::card_api::AllCardsRequest

pub struct AllCardsRequest { /* fields omitted */ }

Request Object to be used to execute requests to the API

Methods

impl AllCardsRequest[src]

pub async fn next_page<'_>(
    &'_ mut self
) -> Result<ApiResponse<Vec<CardDetail>>, Error>
[src]

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.

pub fn order_by(&mut self, field: CardResponseField)[src]

Sets the ordering of the cards

pub fn set_page(&mut self, page: u32)[src]

Sets the page for the following API calls

pub fn set_page_size(&mut self, size: u32)[src]

Sets the page size for the following API calls

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.