Package org.ldk.structs
Class EventHandler
- java.lang.Object
-
- org.ldk.structs.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`.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
EventHandler.EventHandlerInterface
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroys the object, freeing associated resources.protected void
finalize()
void
handle_event(Event event)
Handles the given [`Event`].static EventHandler
new_impl(EventHandler.EventHandlerInterface arg)
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
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.
-
new_impl
public static EventHandler new_impl(EventHandler.EventHandlerInterface arg)
-
handle_event
public void handle_event(Event event)
Handles the given [`Event`]. See [`EventsProvider`] for details that must be considered when implementing this method.
-
-