Inner

Struct Inner 

Source
pub(crate) struct Inner<T> {
    pub(crate) notified: AtomicUsize,
    pub(crate) list: List<T>,
}
Expand description

Inner state of Event.

Fields§

§notified: AtomicUsize

The 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>

Source

fn with_inner<R>(&self, f: impl FnOnce(&mut Inner<T>) -> R) -> R

Source

pub(crate) fn insert(&self, listener: Pin<&mut Option<Listener<T>>>)

Add a new listener to the list.

Source

pub(crate) fn remove( &self, listener: Pin<&mut Option<Listener<T>>>, propagate: bool, ) -> Option<State<T>>

Remove a listener from the list.

Source

pub(crate) fn notify(&self, notify: impl Notification<Tag = T>) -> usize

Notifies a number of entries.

Source

pub(crate) fn register( &self, listener: Pin<&mut Option<Listener<T>>>, task: TaskRef<'_>, ) -> RegisterResult<T>

Register a task to be notified when the event is triggered.

Returns true if the listener was already notified, and false otherwise. If the listener isn’t inserted, returns None.

Source§

impl<T> Inner<T>

Source

pub(crate) fn new() -> Self

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.