Skip to main content

Effect

Struct Effect 

Source
pub struct Effect<P: EffectProvider + ?Sized> {
    pub id: EffectId,
    pub kind: EffectType,
    pub hooks: &'static [EventHook<P>],
}
Expand description

An effect = id/type + a sparse table of hooks (design §1.5). Moves, statuses, abilities, items all share this shape (Showdown’s BasicEffect). The hook table is 'static so registrations are zero-alloc constants.

Fields§

§id: EffectId

The effect’s id.

§kind: EffectType

The effect category (feeds sub_order).

§hooks: &'static [EventHook<P>]

The sparse (Event → HandlerFn) table.

Auto Trait Implementations§

§

impl<P> Freeze for Effect<P>
where P: ?Sized,

§

impl<P> RefUnwindSafe for Effect<P>
where P: ?Sized,

§

impl<P> Send for Effect<P>
where P: ?Sized,

§

impl<P> Sync for Effect<P>
where P: ?Sized,

§

impl<P> Unpin for Effect<P>
where P: ?Sized,

§

impl<P> UnsafeUnpin for Effect<P>
where P: ?Sized,

§

impl<P> UnwindSafe for Effect<P>
where P: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.