[][src]Struct kagura::prelude::Events

pub struct Events {
    pub handlers: HashMap<String, Vec<Box<dyn FnOnce(Event) -> Box<dyn Any>>>>,
    pub rendered: Option<Box<dyn FnOnce(Element) -> Box<dyn Any>>>,
}

Events for Html

Fields

handlers: HashMap<String, Vec<Box<dyn FnOnce(Event) -> Box<dyn Any>>>>rendered: Option<Box<dyn FnOnce(Element) -> Box<dyn Any>>>

Implementations

impl Events[src]

pub fn new() -> Self[src]

Creates new empty Events

pub fn rendered<Msg: 'static>(
    self,
    handler: Option<impl FnOnce(Element) -> Msg + 'static>
) -> Self
[src]

on rendered event

pub fn on<Msg: 'static>(
    self,
    type_: impl Into<String>,
    handler: impl FnOnce(Event) -> Msg + 'static
) -> Self
[src]

Adds event handler

pub fn on_click<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_contextmenu<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_dblclick<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_drag<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_dragend<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_dragenter<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_dragstart<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_dragleave<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_dragover<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_drop<Msg: 'static>(
    self,
    handler: impl FnOnce(DragEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_input<Msg: 'static>(
    self,
    handler: impl FnOnce(String) -> Msg + 'static
) -> Self
[src]

pub fn on_keydown<Msg: 'static>(
    self,
    handler: impl FnOnce(KeyboardEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_keypress<Msg: 'static>(
    self,
    handler: impl FnOnce(KeyboardEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_keyup<Msg: 'static>(
    self,
    handler: impl FnOnce(KeyboardEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_load<Msg: 'static>(
    self,
    handler: impl FnOnce() -> Msg + 'static
) -> Self
[src]

pub fn on_mousedown<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_mouseenter<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_mouseleave<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_mousemove<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_mouseover<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_mouseout<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

pub fn on_mouseup<Msg: 'static>(
    self,
    handler: impl FnOnce(MouseEvent) -> Msg + 'static
) -> Self
[src]

Trait Implementations

impl Clone for Events[src]

Auto Trait Implementations

impl !RefUnwindSafe for Events

impl !Send for Events

impl !Sync for Events

impl Unpin for Events

impl !UnwindSafe for Events

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,