pub struct EventHandler<Ms> {
pub trigger: Ev,
pub callback: Rc<dyn Fn(Event) -> Option<Ms>>,
}Expand description
EventHandlers are called by DOM event listeners with the same trigger (an event to listen to).
Fields§
§trigger: Ev§callback: Rc<dyn Fn(Event) -> Option<Ms>>Implementations§
Trait Implementations§
Source§impl<Ms> Clone for EventHandler<Ms>
impl<Ms> Clone for EventHandler<Ms>
Source§impl<Ms> Debug for EventHandler<Ms>
impl<Ms> Debug for EventHandler<Ms>
Source§impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for EventHandler<Ms>
impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for EventHandler<Ms>
type SelfWithOtherMs = EventHandler<OtherMs>
fn map_msg( self, msg_mapper: impl FnOnce(Ms) -> OtherMs + 'static + Clone, ) -> EventHandler<OtherMs>
Auto Trait Implementations§
impl<Ms> Freeze for EventHandler<Ms>
impl<Ms> !RefUnwindSafe for EventHandler<Ms>
impl<Ms> !Send for EventHandler<Ms>
impl<Ms> !Sync for EventHandler<Ms>
impl<Ms> Unpin for EventHandler<Ms>
impl<Ms> !UnwindSafe for EventHandler<Ms>
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