Module event

Source
Expand description

Event system.

use nexus::{
    event::{ADDON_LOADED, event_consume},
    log::{log, LogLevel}
};
use std::ptr::NonNull;

let callback = event_consume!(|payload: Option<&i32>| {
    if let Some(signature) = payload {
        log(LogLevel::Info, "My Addon", format!("Addon {signature} loaded"));
    }
});

ADDON_LOADED.subscribe(callback);

Modules§

arc
ArcDPS EVTC bridge events.
extras
Unofficial Extras bridge events.
rtapi

Macros§

event_consume
Macro to wrap an event callback.
event_subscribe
Macro to subscribe to an event with a wrapped callback.

Structs§

Event
An event identifier & payload type pair.
MumbleIdentityUpdate
Mumble identity.

Constants§

ADDON_LOADED
Nexus addon loaded event.
ADDON_UNLOADED
Nexus addon unloaded event.
MUMBLE_IDENTITY_UPDATED
Mumble identity updated event.
VOLATILE_ADDON_DISABLED
Nexus volatile addon disabled event.
WINDOW_RESIZED
Window resized event.

Functions§

event_raise
Raises an event to all subscribing addons.
event_raise_notification
Raises an event without payload to all subscribing addons.
event_raise_notification_targeted
Raises an event without payload for a specific subscribing addon.
event_raise_targeted
Raises an event for a specific subscribing addon.
event_subscribe_typed
Subscribes to an event with a raw callback using a typed payload.
event_subscribe_unknown
Subscribes to an event with a raw callback using an unknown payload.
event_unsubscribe
Unsubscribes a previously registered raw event callback.

Type Aliases§

RawEventConsume
RawEventConsumeUnknown
RawEventRaise
RawEventRaiseNotification
RawEventRaiseNotificationTargeted
RawEventRaiseTargeted
RawEventSubscribe