TestApp

Trait TestApp 

Source
pub trait TestApp {
    // Required method
    fn collect_events<E: Event + Clone>(
        &mut self,
    ) -> Box<dyn Iterator<Item = E>>;
}
Expand description

An extension for the standard Bevy app that adds more unit test helper functions.

Required Methods§

Source

fn collect_events<E: Event + Clone>(&mut self) -> Box<dyn Iterator<Item = E>>

Collects all events of the indicated type currently within the system and returns an iterator over all of them.

Note that the events are still removed from the app, even the iterator is not used.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TestApp for App

Source§

fn collect_events<E: Event + Clone>(&mut self) -> Box<dyn Iterator<Item = E>>

Implementors§