Struct Set

Source
#[non_exhaustive]
pub struct Set {
Show 20 fields pub id: Uuid, pub code: SetCode, pub mtgo_code: Option<String>, pub arena_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 printed_size: Option<usize>, pub digital: bool, pub foil_only: bool, pub nonfoil_only: bool, pub scryfall_uri: String, pub uri: Uri<Set>, pub icon_svg_uri: String, pub search_uri: Uri<List<Card>>,
}
Expand description

A Set object containing all fields that scryfall provides.

For more details visit the official docs.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: Uuid

A unique ID for this set on Scryfall that will not change.

§code: SetCode

The unique three to five-letter code for this set.

§mtgo_code: Option<String>

The unique code for this set on MTGO, which may differ from the regular code.

§arena_code: Option<String>

The unique code for this set on Arena, which may differ from the regular code.

§tcgplayer_id: Option<u64>

This set’s ID on TCGplayer’s API, also known as the groupId.

§name: String

The English name of the set.

§set_type: SetType

A computer-readable classification for this set.

§released_at: Option<NaiveDate>

The date the set was released or the first card was printed in the set (in GMT-8 Pacific time).

§block_code: Option<String>

The block code for this set, if any.

§block: Option<String>

The block or group name code for this set, if any.

§parent_set_code: Option<String>

The set code for the parent set, if any. promo and token sets often have a parent set.

§card_count: usize

The number of cards in this set.

§printed_size: Option<usize>

The denominator for the set’s printed collector numbers.

§digital: bool

True if this set was only released in a video game.

§foil_only: bool

True if this set contains only foil cards.

§nonfoil_only: bool

True if this set contains only nonfoil cards.

§scryfall_uri: String

A link to this set’s permapage on Scryfall’s website.

§uri: Uri<Set>

A link to this set object on Scryfall’s API.

§icon_svg_uri: String

A URI to an SVG file for this set’s icon on Scryfall’s CDN. Hotlinking this image isn’t recommended, because it may change slightly over time. You should download it and use it locally for your particular user interface needs.

§search_uri: Uri<List<Card>>

A Scryfall API URI that you can request to begin paginating over the cards in this set.

Implementations§

Source§

impl Set

Source

pub async fn all() -> Result<ListIter<Set>>

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

§Examples
use scryfall::set::Set;
let sets = Set::all().await.unwrap().into_inner().collect::<Vec<_>>();
assert!(sets.len() > 0);
Source

pub async fn code(code: &str) -> Result<Set>

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").await.unwrap().name, "Mercadian Masques")
Source

pub async fn tcgplayer<T: Display>(code: T) -> Result<Set>

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).await.unwrap().name, "Amonkhet Invocations")
Source

pub async fn uuid(uuid: Uuid) -> Result<Set>

Returns a Set with the given Scryfall uuid.

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

pub async fn cards(&self) -> Result<ListIter<Card>>

Returns an iterator over the cards of the set.

Trait Implementations§

Source§

impl Clone for Set

Source§

fn clone(&self) -> Set

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Set

Source§

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

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

impl<'de> Deserialize<'de> for Set

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Set

Source§

fn eq(&self, other: &Set) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Set

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

impl StructuralPartialEq for Set

Auto Trait Implementations§

§

impl Freeze for Set

§

impl RefUnwindSafe for Set

§

impl Send for Set

§

impl Sync for Set

§

impl Unpin for Set

§

impl UnwindSafe for Set

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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