scryfall/card/
card_faces.rs

1use serde::{Deserialize, Serialize};
2use uuid::Uuid;
3
4use crate::card::Color;
5use crate::card::ImageUris;
6
7use super::Layout;
8
9/// Multiface cards have a card_faces property containing at least two Card Face
10/// objects.
11///
12/// ---
13///
14/// For more information, refer to the [official docs](https://scryfall.com/docs/api/cards#card-face-objects).
15#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
16#[non_exhaustive]
17#[cfg_attr(test, serde(deny_unknown_fields))]
18pub struct CardFace {
19    /// The name of the illustrator of this card face. Newly spoiled cards may
20    /// not have this field yet.
21    pub artist: Option<String>,
22
23    /// The colors in this face’s color indicator, if any.
24    pub color_indicator: Option<Vec<Color>>,
25
26    /// This face’s colors, if the game defines colors for the individual face
27    /// of this card.
28    pub colors: Option<Vec<Color>>,
29
30    /// The mana value of this particular face, if the card is reversible.
31    pub cmc: Option<f32>,
32
33    /// The flavor text printed on this face, if any.
34    pub flavor_text: Option<String>,
35
36    /// A unique identifier for the card face artwork that remains consistent
37    /// across reprints. Newly spoiled cards may not have this field yet.
38    pub illustration_id: Option<Uuid>,
39
40    /// An object providing URIs to imagery for this face, if this is a
41    /// double-sided card. If this card is not double-sided, then the image_uris
42    /// property will be part of the parent object instead.
43    pub image_uris: Option<ImageUris>,
44
45    /// This face’s loyalty, if any.
46    pub loyalty: Option<String>,
47
48    /// The mana cost for this face. This value will be any empty string "" if
49    /// the cost is absent. Remember that per the game rules, a missing mana
50    /// cost and a mana cost of `{0}` are different values.
51    pub mana_cost: String,
52
53    /// The name of this particular face.
54    pub name: String,
55
56    /// The Oracle ID of this particular face, if the card is reversible.
57    pub oracle_id: Option<Uuid>,
58
59    /// The Oracle text for this face, if any.
60    pub oracle_text: Option<String>,
61
62    /// This face’s power, if any. Note that some cards have powers that are not
63    /// numeric, such as `*`.
64    pub power: Option<String>,
65
66    /// The localized name printed on this face, if any.
67    pub printed_name: Option<String>,
68
69    /// The localized text printed on this face, if any.
70    pub printed_text: Option<String>,
71
72    /// The type line as printed on the card.
73    pub printed_type_line: Option<String>,
74
75    /// This face’s toughness, if any. Note that some cards have powers that are not
76    /// numeric, such as `*`.
77    pub toughness: Option<String>,
78
79    /// The type line of this particular face.
80    pub type_line: Option<String>,
81
82    /// The watermark on this particulary card face, if any.
83    pub watermark: Option<String>,
84
85    /// The ID of the illustrator of this card face. Newly spoiled cards may not have this field yet.
86    pub artist_id: Option<Uuid>,
87
88    /// The just-for-fun name printed on the card (such as for Godzilla series cards).
89    pub flavor_name: Option<String>,
90
91    /// This face’s defense, if it's a battle.
92    pub defense: Option<String>,
93
94    /// The layout of this card face, if the card is reversible.
95    pub layout: Option<Layout>,
96
97    #[cfg(test)]
98    #[serde(rename = "object")]
99    _object: String,
100}