pub struct NotificationCenter(/* private fields */);Expand description
An Objective-C notification center.
C++ equivalent: NS::NotificationCenter
Implementations§
Source§impl NotificationCenter
impl NotificationCenter
Sourcepub fn default_center() -> Option<Self>
pub fn default_center() -> Option<Self>
Get the default notification center.
C++ equivalent: static class NotificationCenter* defaultCenter()
Sourcepub fn add_observer(
&self,
name: NotificationName,
object: *mut Object,
queue: *mut c_void,
block: *const c_void,
) -> *mut Object
pub fn add_observer( &self, name: NotificationName, object: *mut Object, queue: *mut c_void, block: *const c_void, ) -> *mut Object
Add an observer with a block.
C++ equivalent: Object* addObserver(NotificationName name, Object* pObj, void* pQueue, ObserverBlock block)
Note: The block parameter is a raw pointer to an Objective-C block. Use with mtl_sys block types.
Sourcepub fn remove_observer(&self, observer: &Object)
pub fn remove_observer(&self, observer: &Object)
Remove an observer.
C++ equivalent: void removeObserver(Object* pObserver)
Trait Implementations§
Source§impl Clone for NotificationCenter
impl Clone for NotificationCenter
Source§fn clone(&self) -> NotificationCenter
fn clone(&self) -> NotificationCenter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NotificationCenter
impl Debug for NotificationCenter
Source§impl Referencing for NotificationCenter
impl Referencing for NotificationCenter
Source§fn as_mut_ptr(&self) -> *mut c_void
fn as_mut_ptr(&self) -> *mut c_void
Get the raw mutable pointer to the Objective-C object.
Source§fn retain(&self) -> Selfwhere
Self: Clone,
fn retain(&self) -> Selfwhere
Self: Clone,
Retain the object, incrementing its reference count. Read more
Source§fn autorelease(&self) -> Selfwhere
Self: Clone,
fn autorelease(&self) -> Selfwhere
Self: Clone,
Autorelease the object. Read more
Source§fn retain_count(&self) -> UInteger
fn retain_count(&self) -> UInteger
Get the retain count of the object. Read more
impl Send for NotificationCenter
impl Sync for NotificationCenter
Auto Trait Implementations§
impl Freeze for NotificationCenter
impl RefUnwindSafe for NotificationCenter
impl Unpin for NotificationCenter
impl UnwindSafe for NotificationCenter
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