pub struct ObserverList { /* private fields */ }Expand description
Simple observer list with string-keyed callbacks (stored as labels).
Implementations§
Source§impl ObserverList
impl ObserverList
pub fn new() -> Self
pub fn subscribe(&mut self, label: &str) -> u64
pub fn unsubscribe(&mut self, id: u64) -> bool
pub fn notify(&mut self, _event: &str)
pub fn count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn notify_count(&self) -> u64
pub fn labels(&self) -> Vec<&str>
pub fn has_label(&self, label: &str) -> bool
pub fn clear(&mut self)
pub fn ids(&self) -> Vec<u64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObserverList
impl RefUnwindSafe for ObserverList
impl Send for ObserverList
impl Sync for ObserverList
impl Unpin for ObserverList
impl UnsafeUnpin for ObserverList
impl UnwindSafe for ObserverList
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