pub struct CardDef {
pub id: String,
pub name: String,
pub card_type: String,
pub cost: Option<String>,
pub description: Option<String>,
pub abilities: Vec<CardAbility>,
pub script_path: Option<String>,
pub keywords: Vec<String>,
pub stats: HashMap<String, String>,
}Expand description
Card definition: metadata and abilities for a playable card
Fields§
§id: StringUnique card identifier (can be string or number)
name: StringCard name for display
card_type: StringCard type (e.g., “creature”, “spell”, “enchantment”)
cost: Option<String>Cost to play (could be mana, resources, etc)
description: Option<String>Card text / description
abilities: Vec<CardAbility>Abilities this card has (triggered effects)
script_path: Option<String>Optional path to Rhai script file for scripted behavior
keywords: Vec<String>Keywords this card has (must reference keyword IDs from rules.keywords)
stats: HashMap<String, String>Card stats (e.g., power/toughness for creatures, generic key-value pairs)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CardDef
impl<'de> Deserialize<'de> for CardDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CardDef
impl RefUnwindSafe for CardDef
impl Send for CardDef
impl Sync for CardDef
impl Unpin for CardDef
impl UnwindSafe for CardDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more