Struct SearchOptions

Source
pub struct SearchOptions { /* private fields */ }
Expand description

Advanced searching options for Scryfall, including unique de-duplication strategy, sort order, page number, and any extras to include. For documentation on each option, refer to this struct’s methods.

For more information, refer to the official docs.

Implementations§

Source§

impl SearchOptions

Source

pub fn new() -> Self

Constructs a new SearchOptions with default values and an empty query.

Source

pub fn with_query(query: Query) -> Self

Constructs a new SearchOptions with default values and the specified query.

Source

pub fn query(&mut self, query: Query) -> &mut Self

Sets the query to use for this search.

Source

pub fn page(&mut self, page: usize) -> &mut Self

Sets the page number to start with. Page 0 is equivalent to page 1.

Source

pub fn unique(&mut self, unique: UniqueStrategy) -> &mut Self

Sets the strategy for omitting similar cards.

Source

pub fn sort(&mut self, order: SortOrder, dir: SortDirection) -> &mut Self

Sets the sort order and direction for returned cards.

Source

pub fn order(&mut self, order: SortOrder) -> &mut Self

Sets the sort order for returned cards.

Source

pub fn direction(&mut self, dir: SortDirection) -> &mut Self

Sets the sort direction for returned cards.

Source

pub fn extras(&mut self, include_extras: bool) -> &mut Self

If true, extra cards (tokens, planes, etc) will be included.

Source

pub fn multilingual(&mut self, include_multilingual: bool) -> &mut Self

If true, cards in every language supported by Scryfall will be included.

Source

pub fn variations(&mut self, include_variations: bool) -> &mut Self

If true, rare care variants will be included, like the Hairy Runesword.

Trait Implementations§

Source§

impl Debug for SearchOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SearchOptions

Source§

fn default() -> SearchOptions

Returns the “default value” for a type. Read more
Source§

impl Search for SearchOptions

Source§

fn write_query(&self, url: &mut Url) -> Result<()>

Write this search as the query for the given Url.
Source§

fn search<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ListIter<Card>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Convenience method for passing this object to Card::search.
Source§

fn search_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Card>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Convenience method for passing this object to Card::search_all.
Source§

fn random<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Card>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Convenience method for passing this object to Card::search_random.
Source§

impl Serialize for SearchOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,