Struct scryfall::set::Set[][src]

pub struct Set {
    pub id: Uuid,
    pub code: SetCode,
    pub mtgo_code: Option<String>,
    pub tcgplayer_id: Option<u64>,
    pub name: String,
    pub set_type: SetType,
    pub released_at: Option<NaiveDate>,
    pub block_code: Option<String>,
    pub block: Option<String>,
    pub parent_set_code: Option<String>,
    pub card_count: usize,
    pub digital: bool,
    pub foil_only: bool,
    pub scryfall_uri: String,
    pub uri: URI<Set>,
    pub icon_svg_uri: String,
    pub search_uri: PaginatedURI<Card>,
}

A Set object containing all fields that scryfall provides.

For documentation on each field please refer to their documentation

Fields

id: Uuidcode: SetCodemtgo_code: Option<String>tcgplayer_id: Option<u64>name: Stringset_type: SetTypereleased_at: Option<NaiveDate>block_code: Option<String>block: Option<String>parent_set_code: Option<String>card_count: usizedigital: boolfoil_only: boolscryfall_uri: Stringuri: URI<Set>icon_svg_uri: Stringsearch_uri: PaginatedURI<Card>

Implementations

impl Set[src]

pub fn all() -> PaginatedURI<Set>

Notable traits for PaginatedURI<T>

impl<T: DeserializeOwned> Iterator for PaginatedURI<T> type Item = Result<Vec<T>>;
[src]

Returns a PaginatedURI of all the sets in the scryfall database.

Examples

use scryfall::set::Set;
match Set::all().next().unwrap() {
    Ok(sets) => assert_ne!(sets.len(), 0),
    Err(e) => eprintln!("{:?}", e)
}

pub fn code(code: &str) -> Result<Set>[src]

Returns a Set with the given set code.

The code can be either the code or the mtgo_code for the set.

Examples

use scryfall::set::Set;
assert_eq!(Set::code("mmq").unwrap().name, "Mercadian Masques")

pub fn tcgplayer<T: Display>(code: T) -> Result<Set>[src]

Returns a Set with the given tcgplayer_id.

Also known as the groupId on TCGplayer’s API.

Examples

use scryfall::set::Set;
assert_eq!(Set::tcgplayer(1909).unwrap().name, "Amonkhet Invocations")

pub fn uuid(uuid: Uuid) -> Result<Set>[src]

Returns a Set with the given Scryfall uuid.

Examples

use scryfall::set::Set;
assert_eq!(
    Set::uuid("2ec77b94-6d47-4891-a480-5d0b4e5c9372".to_string()).unwrap().name,
    "Ultimate Masters")

pub fn cards(&self) -> &PaginatedURI<Card>

Notable traits for PaginatedURI<T>

impl<T: DeserializeOwned> Iterator for PaginatedURI<T> type Item = Result<Vec<T>>;
[src]

Returns an iterartor over the cards of the set.

Trait Implementations

impl Clone for Set[src]

impl Debug for Set[src]

impl<'de> Deserialize<'de> for Set[src]

impl PartialEq<Set> for Set[src]

impl Serialize for Set[src]

impl StructuralPartialEq for Set[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.