pub(crate) struct Inner<T> {
pub(crate) notified: AtomicUsize,
pub(crate) list: List<T>,
}Expand description
Inner state of Event.
Fields§
§notified: AtomicUsizeThe number of notified entries, or usize::MAX if all of them have been notified.
If there are no entries, this value is set to usize::MAX.
list: List<T>Inner queue of event listeners.
On std platforms, this is an intrusive linked list. On no_std platforms, this is a
more traditional Vec of listeners, with an atomic queue used as a backup for high
contention.
Implementations§
Source§impl<T> Inner<T>
impl<T> Inner<T>
fn with_inner<R>(&self, f: impl FnOnce(&mut Inner<T>) -> R) -> R
Sourcepub(crate) fn insert(&self, listener: Pin<&mut Option<Listener<T>>>)
pub(crate) fn insert(&self, listener: Pin<&mut Option<Listener<T>>>)
Add a new listener to the list.
Sourcepub(crate) fn remove(
&self,
listener: Pin<&mut Option<Listener<T>>>,
propagate: bool,
) -> Option<State<T>>
pub(crate) fn remove( &self, listener: Pin<&mut Option<Listener<T>>>, propagate: bool, ) -> Option<State<T>>
Remove a listener from the list.
Sourcepub(crate) fn notify(&self, notify: impl Notification<Tag = T>) -> usize
pub(crate) fn notify(&self, notify: impl Notification<Tag = T>) -> usize
Notifies a number of entries.
Auto Trait Implementations§
impl<T> !Freeze for Inner<T>
impl<T> RefUnwindSafe for Inner<T>
impl<T> !Send for Inner<T>
impl<T> !Sync for Inner<T>
impl<T> Unpin for Inner<T>
impl<T> UnwindSafe for Inner<T>
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