pub struct SCPickerSubscription { /* private fields */ }Expand description
Handle representing a live repeating-observer registration.
The observer is removed when this value is dropped. Call
Self::detach to keep the observer alive for the rest of the process.
Implementations§
Source§impl SCPickerSubscription
impl SCPickerSubscription
Sourcepub const fn token(&self) -> i64
pub const fn token(&self) -> i64
Opaque identifier for this registration. Non-zero when registration succeeded.
Sourcepub fn unsubscribe(self) -> bool
pub fn unsubscribe(self) -> bool
Remove the observer now instead of waiting for the drop.
Returns true if a live observer was removed.
Sourcepub fn detach(self)
pub fn detach(self)
Give up ownership without removing the observer, keeping it registered for the remainder of the process.
Useful for “install once at startup” wiring where there is no natural
owner for the handle. The registration can still be torn down with
SCContentSharingPicker::remove_all_observers.
Trait Implementations§
Source§impl Debug for SCPickerSubscription
impl Debug for SCPickerSubscription
Source§impl Drop for SCPickerSubscription
impl Drop for SCPickerSubscription
Auto Trait Implementations§
impl Freeze for SCPickerSubscription
impl RefUnwindSafe for SCPickerSubscription
impl Send for SCPickerSubscription
impl Sync for SCPickerSubscription
impl Unpin for SCPickerSubscription
impl UnsafeUnpin for SCPickerSubscription
impl UnwindSafe for SCPickerSubscription
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