[−][src]Struct scryfall::card_searcher::SearchBuilder
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
with_unique_strategy
: The strategy used to reduce duplicates. (default: SeeUniqueStrategy
)sorting_by
: The order in which results appear. (default: SeeSortMethod
)with_sort_direction
: The sorting direction. (default: SeeSortDirection
)on_page
: The page to start at. (default: 1)including_extras
: Whether to include extras. (default: false)including_multilingual
: Whether to include multilingual cards. (default: false)including_variations
: Whether to include variations. (default: false)
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 Search for SearchBuilder
[src]
impl Default for SearchBuilder
[src]
Auto Trait Implementations
impl Unpin for SearchBuilder
impl !Sync for SearchBuilder
impl !Send for SearchBuilder
impl !UnwindSafe for SearchBuilder
impl !RefUnwindSafe for SearchBuilder
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,