Struct CancelHandle
pub struct CancelHandle { /* private fields */ }Expand description
Handle to cancel a subscription. Dropping this stops event delivery.
Implementations§
§impl CancelHandle
impl CancelHandle
pub fn new(cancel_fn: impl FnOnce() + Send + 'static) -> CancelHandle
pub fn new(cancel_fn: impl FnOnce() + Send + 'static) -> CancelHandle
Create a cancel handle with a cancellation callback.
pub fn noop() -> CancelHandle
pub fn noop() -> CancelHandle
Create a no-op cancel handle.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CancelHandle
impl !RefUnwindSafe for CancelHandle
impl Send for CancelHandle
impl !Sync for CancelHandle
impl Unpin for CancelHandle
impl !UnwindSafe for CancelHandle
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