pub struct Event<T> {
pub identifier: &'static str,
/* private fields */
}Expand description
An event identifier & payload type pair.
Fields§
§identifier: &'static strImplementations§
Source§impl<T> Event<T>
impl<T> Event<T>
Sourcepub fn subscribe(
&self,
callback: RawEventConsume<T>,
) -> Revertible<impl Fn() + Send + Sync + Clone + 'static>
pub fn subscribe( &self, callback: RawEventConsume<T>, ) -> Revertible<impl Fn() + Send + Sync + Clone + 'static>
Subscribes to the event.
Sourcepub fn unsubscribe(&self, callback: RawEventConsume<T>)
pub fn unsubscribe(&self, callback: RawEventConsume<T>)
Unsubscribes a previously registered event callback.
Trait Implementations§
impl<T: Copy> Copy for Event<T>
Auto Trait Implementations§
impl<T> Freeze for Event<T>
impl<T> RefUnwindSafe for Event<T>where
T: RefUnwindSafe,
impl<T> Send for Event<T>where
T: Send,
impl<T> Sync for Event<T>where
T: Sync,
impl<T> Unpin for Event<T>where
T: Unpin,
impl<T> UnsafeUnpin for Event<T>
impl<T> UnwindSafe for Event<T>where
T: UnwindSafe,
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