Skip to main content

AbilityApiBased

Trait AbilityApiBased 

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

Marker trait for API-based abilities.

In Java, AbilityApiBased extends AbilityActivated and holds a reference to SpellAbilityEffect which is used for resolution and stack description. In Rust the effect dispatch is handled centrally via effect_dispatch!, so this trait serves as a structural marker for type 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 ability by dispatching to the effect system.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§