pub struct ExampleEvent<'a> { /* private fields */ }Expand description
Sample event generated using event! macro.
Implementations§
Source§impl<'a> ExampleEvent<'a>
impl<'a> ExampleEvent<'a>
Sourcepub fn subscribe<F>(&mut self, handler: F) -> Subscription
pub fn subscribe<F>(&mut self, handler: F) -> Subscription
Subscribes a closure to be called on event emmision.
Return subscription token.
Sourcepub fn unsubscribe(
&mut self,
subscription: Subscription,
) -> Result<(), SubscriptionMissing>
pub fn unsubscribe( &mut self, subscription: Subscription, ) -> Result<(), SubscriptionMissing>
Unsubscribes handler for given subscription token.
Returns error if there is no handler for given subscription.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ExampleEvent<'a>
impl<'a> !RefUnwindSafe for ExampleEvent<'a>
impl<'a> !Send for ExampleEvent<'a>
impl<'a> Sync for ExampleEvent<'a>
impl<'a> Unpin for ExampleEvent<'a>
impl<'a> !UnwindSafe for ExampleEvent<'a>
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