pub struct Event<T> { /* private fields */ }Expand description
A struct which represents some event.
Generic parameter T is a type of argument which callbacks accept.
Implementations§
Source§impl<T> Event<T>
impl<T> Event<T>
Sourcepub fn connect<F>(&self, callback: F) -> usize
pub fn connect<F>(&self, callback: F) -> usize
Registers the provided callback to invoke when the event is emitted.
Returns an ID which can be used to unregister the callback using
disconnect.
Sourcepub fn disconnect(&self, handle: usize)
pub fn disconnect(&self, handle: usize)
Unregister the callback by its ID.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Event<T>
impl<T> RefUnwindSafe for Event<T>
impl<T> Send for Event<T>
impl<T> Sync for Event<T>
impl<T> Unpin for Event<T>
impl<T> UnsafeUnpin for Event<T>
impl<T> UnwindSafe for Event<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