[][src]Trait scryfall::card_searcher::Search

pub trait Search {
    fn to_query(&self) -> String;
}

Search expresses that the implementing type can be turned into a query to scryfall. This means that is should be properly encoded.

Required methods

fn to_query(&self) -> String

Turns a searchable into it's string representation.

Loading content...

Implementations on Foreign Types

impl<'_, T> Search for &'_ T where
    T: Search
[src]

impl<'_, T> Search for &'_ mut T where
    T: Search
[src]

impl<'_> Search for &'_ str[src]

fn to_query(&self) -> String[src]

This guarantees that the query is properly encoded. Be wary that you need to follow scryfall syntax.

The use case of this implementation is usually this. (See Card::search for details)

use scryfall::card::Card;
assert!(Card::search("lightning")
    .filter_map(|x| x.ok())
    .flatten()
    .all(|x| x.name.to_lowercase().contains("lightning")))
Loading content...

Implementors

Loading content...