pub struct EventName(/* private fields */);Expand description
A human-readable name for an event.
EventName is used for:
- Event handler registration (EventId computed from name at registration time)
- Error messages and debugging
- Resolving EventIds back to names via the event registry
System events use the “sys::” namespace prefix to distinguish them from user-defined events.
For event identification during execution (e.g., reading from the stack), use EventId
directly. Names can be looked up via the event registry when needed for error reporting.
Implementations§
Source§impl EventName
impl EventName
Sourcepub const fn new(name: &'static str) -> Self
pub const fn new(name: &'static str) -> Self
Creates an EventName from a static string.
This is the primary constructor for compile-time event name constants.
Sourcepub fn from_string(name: String) -> Self
pub fn from_string(name: String) -> Self
Creates an EventName from an owned String.
Use this for dynamically constructed event names (e.g., in error messages).
Sourcepub fn to_event_id(&self) -> EventId
pub fn to_event_id(&self) -> EventId
Returns the EventId for this event name.
The ID is computed by hashing the name using blake3.
Trait Implementations§
Source§impl Deserializable for EventName
impl Deserializable for EventName
Source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl From<SystemEvent> for EventName
impl From<SystemEvent> for EventName
Source§fn from(system_event: SystemEvent) -> Self
fn from(system_event: SystemEvent) -> Self
Converts to this type from the input type.
Source§impl Serializable for EventName
impl Serializable for EventName
Source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self into bytes and writes these bytes into the target.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Eq for EventName
impl StructuralPartialEq for EventName
Auto Trait Implementations§
impl Freeze for EventName
impl RefUnwindSafe for EventName
impl Send for EventName
impl Sync for EventName
impl Unpin for EventName
impl UnwindSafe for EventName
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more