[][src]Struct seed::virtual_dom::event_handler_manager::event_handler::EventHandler

pub struct EventHandler<Ms> {
    pub trigger: Ev,
    pub callback: Rc<dyn Fn(Event) -> Ms>,
}

EventHandlers are called by DOM event listeners with the same trigger (an event to listen to).

Fields

trigger: Evcallback: Rc<dyn Fn(Event) -> Ms>

Methods

impl<Ms> EventHandler<Ms>[src]

pub fn new(
    trigger: impl Into<Ev>,
    callback: impl Fn(Event) -> Ms + 'static
) -> Self
[src]

Trait Implementations

impl<Ms> Clone for EventHandler<Ms>[src]

impl<Ms> Debug for EventHandler<Ms>[src]

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for EventHandler<Ms>[src]

type SelfWithOtherMs = EventHandler<OtherMs>

impl<Ms> UpdateEl<El<Ms>> for EventHandler<Ms>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.