pub struct EventHook<P: EffectProvider + ?Sized> {
pub event: Event,
pub call: HandlerFn<P>,
pub order: u32,
pub priority: i32,
pub sub_order: Option<u8>,
}Expand description
One (Event → HandlerFn) subscription with its ordering metadata
(design §1.5). order/priority/sub_order mirror Showdown’s
on<Event>Order / on<Event>Priority / effect-type sub-order.
Fields§
§event: EventWhich event this hook subscribes to.
call: HandlerFn<P>The native handler.
order: u32on<Event>Order; default u32::MAX fires last; LOW first.
priority: i32on<Event>Priority; HIGH first.
sub_order: Option<u8>Optional explicit sub-order override; None ⇒ derive from effect type.
Trait Implementations§
impl<P: EffectProvider + ?Sized> Copy for EventHook<P>
Auto Trait Implementations§
impl<P> Freeze for EventHook<P>where
P: ?Sized,
impl<P> RefUnwindSafe for EventHook<P>where
P: ?Sized,
impl<P> Send for EventHook<P>where
P: ?Sized,
impl<P> Sync for EventHook<P>where
P: ?Sized,
impl<P> Unpin for EventHook<P>where
P: ?Sized,
impl<P> UnsafeUnpin for EventHook<P>where
P: ?Sized,
impl<P> UnwindSafe for EventHook<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