pub struct Subscription {
pub event_name: String,
pub id: usize,
/* private fields */
}Expand description
A subscription handle that allows unsubscribing or graceful shutdown.
Fields§
§event_name: StringThe event name or pattern this subscription is bound to.
id: usizeUnique subscription identifier.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn unsubscribe(&self)
pub fn unsubscribe(&self)
Unsubscribe by aborting the background handler task.
After calling this, the handler will no longer receive events. This is idempotent — calling it multiple times has no effect.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Check if this subscription is still active.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Subscription
impl !UnwindSafe for Subscription
impl Freeze for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnsafeUnpin for Subscription
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