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

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[src]

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...