Skip to main content

EventHandlerRegistration

Struct EventHandlerRegistration 

Source
pub struct EventHandlerRegistration {
    pub event_type: &'static str,
    pub priority: u32,
    pub description: &'static str,
    pub once: bool,
    pub target_component: Option<&'static str>,
    pub depends_on: &'static [&'static str],
    pub flags: RegistrationFlags,
}
Expand description

Event handler registration descriptor.

Linux equivalent: Like struct notifier_block - declares event subscription.

Priority convention (from EventBus):

  • 0-50: Core handlers (kernel-level)
  • 100: Default plugin priority
  • 200+: Cleanup/late handlers

Fields§

§event_type: &'static str

Event type name (e.g., BufferChanged, CursorMoved).

§priority: u32

Handler priority (lower = called earlier).

§description: &'static str

Description for debugging/introspection.

§once: bool

Whether handler auto-unsubscribes after one event (one-shot).

§target_component: Option<&'static str>

Optional target component ID for scoped events.

§depends_on: &'static [&'static str]

Dependencies on other handlers or modules.

§flags: RegistrationFlags

Registration flags.

Implementations§

Source§

impl EventHandlerRegistration

Source

pub const fn new(event_type: &'static str) -> Self

Create a new event handler registration.

Source

pub const fn with_priority(self, priority: u32) -> Self

Set priority.

Source

pub const fn with_description(self, desc: &'static str) -> Self

Set description.

Source

pub const fn with_once(self) -> Self

Mark as one-shot handler.

Source

pub const fn with_target(self, component: &'static str) -> Self

Set target component.

Source

pub const fn with_depends_on(self, deps: &'static [&'static str]) -> Self

Set dependencies.

Source

pub const fn with_flags(self, flags: RegistrationFlags) -> Self

Set registration flags.

Source

pub const fn core_priority(self, priority: u32) -> Self

Set core priority (clamped to 0-50 range).

Trait Implementations§

Source§

impl Clone for EventHandlerRegistration

Source§

fn clone(&self) -> EventHandlerRegistration

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventHandlerRegistration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.