pub struct ObserverRegistry { /* private fields */ }Expand description
The set of registered observers.
The layout cache and the model indices are ordinary members of this set; they hold no privileged path into the model.
Implementations§
Source§impl ObserverRegistry
impl ObserverRegistry
Sourcepub fn register(&mut self, observer: Arc<dyn AstObserver>) -> ObserverToken
pub fn register(&mut self, observer: Arc<dyn AstObserver>) -> ObserverToken
Register an observer, returning the token that removes it again.
Sourcepub fn unregister(&mut self, token: ObserverToken) -> bool
pub fn unregister(&mut self, token: ObserverToken) -> bool
Remove an observer. Returns whether it was registered.
Trait Implementations§
Source§impl Clone for ObserverRegistry
impl Clone for ObserverRegistry
Source§impl Debug for ObserverRegistry
impl Debug for ObserverRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for ObserverRegistry
impl !UnwindSafe for ObserverRegistry
impl Freeze for ObserverRegistry
impl Send for ObserverRegistry
impl Sync for ObserverRegistry
impl Unpin for ObserverRegistry
impl UnsafeUnpin for ObserverRegistry
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