Class EventHandler


  • public class EventHandler
    extends Object
    A trait implemented for objects handling events from [`EventsProvider`]. An async variation also exists for implementations of [`EventsProvider`] that support async event handling. The async event handler should satisfy the generic bounds: `F: core::future::Future, H: Fn(Event) -> F`.
    • Method Detail

      • destroy

        public void destroy()
        Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
      • handle_event

        public void handle_event​(Event event)
        Handles the given [`Event`]. See [`EventsProvider`] for details that must be considered when implementing this method.