pub struct CallbackContext { /* private fields */ }Expand description
Context passed to every callback invocation.
The context contains only a weak control reference, so retaining it does not keep the subscription or callback alive. It can be used to request unsubscription from inside the callback.
Implementations§
Source§impl CallbackContext
impl CallbackContext
Sourcepub fn id(&self) -> SubscriptionId
pub fn id(&self) -> SubscriptionId
Return the identifier of the subscription invoking the callback.
Sourcepub fn unsubscribe(&self) -> bool
pub fn unsubscribe(&self) -> bool
Request unsubscription through this callback context.
Returns false when the subscription has already been dropped or
detached. The request is synchronous and does not wait for the current
callback invocation to return.
Trait Implementations§
Source§impl Clone for CallbackContext
impl Clone for CallbackContext
Auto Trait Implementations§
impl !RefUnwindSafe for CallbackContext
impl !UnwindSafe for CallbackContext
impl Forget for CallbackContext
impl Freeze for CallbackContext
impl Move for CallbackContext
impl Send for CallbackContext
impl Sync for CallbackContext
impl Unpin for CallbackContext
impl UnsafeUnpin for CallbackContext
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