pub struct Link<'link, S> { /* private fields */ }
Expand description
Used to attach message handlers.
Implementations§
source§impl<'link, S> Link<'link, S>
impl<'link, S> Link<'link, S>
sourcepub fn register<E, F, HandlerKind>(&self, callback: F) -> Keywhere
E: Event,
F: IntoHandler<'link, S, E, HandlerKind>,
pub fn register<E, F, HandlerKind>(&self, callback: F) -> Keywhere
E: Event,
F: IntoHandler<'link, S, E, HandlerKind>,
Register a new callback.
sourcepub fn register_by_id<E, F, HandlerKind>(
&self,
msg_types: &[u16],
callback: F
) -> Keywhere
E: Event,
F: IntoHandler<'link, S, E, HandlerKind>,
pub fn register_by_id<E, F, HandlerKind>(
&self,
msg_types: &[u16],
callback: F
) -> Keywhere
E: Event,
F: IntoHandler<'link, S, E, HandlerKind>,
Register a new callback with manually specified message types.
sourcepub fn unregister(&self, key: Key)
pub fn unregister(&self, key: Key)
Remove a previously registered callback.
Trait Implementations§
Auto Trait Implementations§
impl<'link, S> Freeze for Link<'link, S>
impl<'link, S> RefUnwindSafe for Link<'link, S>
impl<'link, S> Send for Link<'link, S>
impl<'link, S> Sync for Link<'link, S>
impl<'link, S> Unpin for Link<'link, S>
impl<'link, S> UnwindSafe for Link<'link, S>
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