pub struct EventKey<T> { /* private fields */ }Expand description
A stable routing key whose payload type is checked by Rust.
Keys are compared by name. An Application rejects attempts to subscribe to the same name with different payload types.
Implementations§
Source§impl<T> EventKey<T>
impl<T> EventKey<T>
Sourcepub const fn new(name: &'static str) -> Self
pub const fn new(name: &'static str) -> Self
Creates a static Event key.
A key must be non-empty, at most 128 bytes, and contain only lowercase
ASCII letters, digits, ., _, -, or :.
Sourcepub fn dynamic(name: impl Into<Arc<str>>) -> Result<Self, InvalidEventKey>
pub fn dynamic(name: impl Into<Arc<str>>) -> Result<Self, InvalidEventKey>
Creates a runtime Event key, for example from a server-provided event name. Invalid names are rejected before they reach the Event bus.
pub fn as_str(&self) -> &str
Trait Implementations§
impl<T> Eq for EventKey<T>
Auto Trait Implementations§
impl<T> Freeze for EventKey<T>
impl<T> RefUnwindSafe for EventKey<T>
impl<T> Send for EventKey<T>
impl<T> Sync for EventKey<T>
impl<T> Unpin for EventKey<T>
impl<T> UnsafeUnpin for EventKey<T>
impl<T> UnwindSafe for EventKey<T>
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