[][src]Struct bevy::app::EventReader

pub struct EventReader<T> { /* fields omitted */ }

Reads events of type T in order and tracks which events have already been read.

Implementations

impl<T> EventReader<T>[src]

pub fn iter(&mut self, events: &'a Events<T>) -> impl DoubleEndedIterator[src]

Iterates over the events this EventReader has not seen yet. This updates the EventReader's event counter, which means subsequent event reads will not include events that happened before now.

pub fn latest(&mut self, events: &'a Events<T>) -> Option<&'a T>[src]

Retrieves the latest event that this EventReader hasn't seen yet. This updates the EventReader's event counter, which means subsequent event reads will not include events that happened before now.

pub fn find_latest(
    &mut self,
    events: &'a Events<T>,
    predicate: impl FnMut(&&T) -> bool
) -> Option<&'a T>
[src]

Retrieves the latest event that matches the given predicate that this reader hasn't seen yet. This updates the EventReader's event counter, which means subsequent event reads will not include events that happened before now.

pub fn earliest(&mut self, events: &'a Events<T>) -> Option<&'a T>[src]

Retrieves the earliest event in events that this reader hasn't seen yet. This updates the EventReader's event counter, which means subsequent event reads will not include events that happened before now.

Trait Implementations

impl<T> Default for EventReader<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for EventReader<T> where
    T: RefUnwindSafe

impl<T> Send for EventReader<T> where
    T: Send

impl<T> Sync for EventReader<T> where
    T: Sync

impl<T> Unpin for EventReader<T> where
    T: Unpin

impl<T> UnwindSafe for EventReader<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> FromResources for T where
    T: Default
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,