Skip to main content

SpellApiBased

Trait SpellApiBased 

Source
pub trait SpellApiBased {
    // Required methods
    fn api_type(&self) -> &str;
    fn resolve(&self, sa: &SpellAbility);

    // Provided method
    fn is_intrinsic(&self) -> bool { ... }
}
Expand description

Marker trait for API-based spell abilities.

In Java, SpellApiBased extends Spell and holds a reference to SpellAbilityEffect. In Rust the dispatch is centralized in effect_dispatch!, so this provides structural parity.

Required Methods§

Source

fn api_type(&self) -> &str

The API type string (e.g. “DealDamage”, “GainLife”).

Source

fn resolve(&self, sa: &SpellAbility)

Resolve this spell by dispatching to the effect system.

Provided Methods§

Source

fn is_intrinsic(&self) -> bool

Whether this spell is intrinsic to its card.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§