[][src]Struct scryfall::card_searcher::SearchBuilder

pub struct SearchBuilder { /* fields omitted */ }

A search builder for constructing a Search for scryfall. The various parameters that can be passed to this struct are defined in this module.

A search is composed of settings and params.

Settings

The in depth documentation for the settings can be found here

Parameters

Parameters are filters to provide to the search to reduce the cards returned.

The official documentation for the parameters can be found here

Methods

impl SearchBuilder[src]

pub fn new() -> Self[src]

Create a new search builder with the default values.

pub fn with_unique_strategy(&mut self, strat: UniqueStrategy) -> &mut Self[src]

Change the unique strategy to be used to remove repeated cards.

pub fn sorting_by(&mut self, method: SortMethod) -> &mut Self[src]

Change the sorting method used for the results.

pub fn with_sort_direction(&mut self, dir: SortDirection) -> &mut Self[src]

Change the direction in which things are sorted.

pub fn including_extras(&mut self) -> &mut Self[src]

Enable the inclusion of extras.

pub fn including_multilingual(&mut self) -> &mut Self[src]

Enable the inclusion of multilingual cards.

pub fn including_variations(&mut self) -> &mut Self[src]

Enable the inclusion of variations on cards.

pub fn on_page(&mut self, page: usize) -> &mut Self[src]

Change the starting page of the search.

pub fn param(&mut self, param: Box<dyn Param>) -> &mut Self[src]

Add a param to the search.

Important traits for PaginatedURI<T>
pub fn search(&mut self) -> PaginatedURI<Card>[src]

A covenience method for passing this to a search.

Examples

use scryfall::card::Card;
use scryfall::card_searcher::{
    NumericParam::CollectorNumber, Search, SearchBuilder, StringParam::Set,
};
use scryfall::set::SetCode;
use std::convert::TryFrom;

assert_eq!(
    Card::search(
        SearchBuilder::new()
            .param(Box::new(CollectorNumber(123)))
            .param(Box::new(Set(SetCode::try_from("war").unwrap())))
    )
    .flatten()
    .collect::<Vec<_>>(),
    SearchBuilder::new()
        .param(Box::new(CollectorNumber(123)))
        .param(Box::new(Set(SetCode::try_from("war").unwrap())))
        .search()
        .flatten()
        .collect::<Vec<_>>()
);

Trait Implementations

impl Default for SearchBuilder[src]

Auto Trait Implementations

Blanket Implementations

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.

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

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

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

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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