Struct hotdrink_wasm::event::event_handler::EventHandler [−][src]
pub struct EventHandler<T, E> { /* fields omitted */ }
The main event handler containing the callbacks for variables.
Implementations
impl<T: Into<JsValue> + Clone + Debug, E: Display + Debug> EventHandler<T, E>
[src]
impl<T: Into<JsValue> + Clone + Debug, E: Display + Debug> EventHandler<T, E>
[src]pub fn new() -> Self
[src]
Construct a new event handler that reacts to no events.
pub fn set_on_pending(
&mut self,
component: &str,
variable: &str,
on_pending: Function
) -> Option<()>
[src]
&mut self,
component: &str,
variable: &str,
on_pending: Function
) -> Option<()>
Sets the callback to call when the specified variable starts waiting for a new value.
pub fn set_on_ready(
&mut self,
component: &str,
variable: &str,
on_ready: Function
) -> Option<()>
[src]
&mut self,
component: &str,
variable: &str,
on_ready: Function
) -> Option<()>
Sets the callback to call when the specified variable succeeds in getting a new value.
pub fn set_on_error(
&mut self,
component: &str,
variable: &str,
on_error: Function
) -> Option<()>
[src]
&mut self,
component: &str,
variable: &str,
on_error: Function
) -> Option<()>
Sets the callback to call when the specified variable fails to get a new value.
pub fn unsubscribe(&mut self, component: &str, variable: &str)
[src]
Removes the callback for a specific variable from the event handler.
pub fn handle_event(&mut self, event: JsEvent<T, E>) -> Result<(), JsValue>
[src]
Handles an event based on the attached callbacks.
Trait Implementations
impl<T: Clone, E: Clone> Clone for EventHandler<T, E>
[src]
impl<T: Clone, E: Clone> Clone for EventHandler<T, E>
[src]fn clone(&self) -> EventHandler<T, E>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug, E: Debug> Debug for EventHandler<T, E>
[src]
impl<T: Debug, E: Debug> Debug for EventHandler<T, E>
[src]impl<T, E> Default for EventHandler<T, E>
[src]
impl<T, E> Default for EventHandler<T, E>
[src]impl<T: Eq, E: Eq> Eq for EventHandler<T, E>
[src]
impl<T: Eq, E: Eq> Eq for EventHandler<T, E>
[src]impl<T: PartialEq, E: PartialEq> PartialEq<EventHandler<T, E>> for EventHandler<T, E>
[src]
impl<T: PartialEq, E: PartialEq> PartialEq<EventHandler<T, E>> for EventHandler<T, E>
[src]fn eq(&self, other: &EventHandler<T, E>) -> bool
[src]
fn ne(&self, other: &EventHandler<T, E>) -> bool
[src]
impl<T, E> StructuralEq for EventHandler<T, E>
[src]
impl<T, E> StructuralEq for EventHandler<T, E>
[src]impl<T, E> StructuralPartialEq for EventHandler<T, E>
[src]
impl<T, E> StructuralPartialEq for EventHandler<T, E>
[src]Auto Trait Implementations
impl<T, E> RefUnwindSafe for EventHandler<T, E> where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> RefUnwindSafe for EventHandler<T, E> where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> !Send for EventHandler<T, E>
impl<T, E> !Send for EventHandler<T, E>
impl<T, E> !Sync for EventHandler<T, E>
impl<T, E> !Sync for EventHandler<T, E>
impl<T, E> Unpin for EventHandler<T, E> where
E: Unpin,
T: Unpin,
impl<T, E> Unpin for EventHandler<T, E> where
E: Unpin,
T: Unpin,
impl<T, E> UnwindSafe for EventHandler<T, E> where
E: UnwindSafe,
T: UnwindSafe,
impl<T, E> UnwindSafe for EventHandler<T, E> where
E: UnwindSafe,
T: UnwindSafe,