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: EffectIdThe effect’s id.
kind: EffectTypeThe 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> 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