Skip to main content

StaticAbilityApiBased

Trait StaticAbilityApiBased 

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

Marker trait for API-based static abilities.

In Java, StaticAbilityApiBased extends AbilityStatic 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. “Pump”, “Animate”).

Source

fn resolve(&self, sa: &SpellAbility)

Resolve this static 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§