pub struct Subscription { /* private fields */ }Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn unsubscribe(self)
pub fn unsubscribe(self)
Cancels the ongoing WebSocket event subscription and stops the event processing task.
This method aborts the background task responsible for receiving and processing WebSocket events, effectively unsubscribing from further event notifications.
§Examples
let emitter = WebsocketEventEmitter::new();
let subscription = emitter.subscribe(|event| {
// Handle WebSocket event
});
subscription.unsubscribe(); // Stop receiving events
Auto Trait Implementations§
impl Freeze for Subscription
impl RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnwindSafe 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