[]Struct bevy::app::App

pub struct App {
    pub world: World,
    pub resources: Resources,
    pub runner: Box<dyn Fn(App) + 'static, Global>,
    pub schedule: Schedule,
}

Containers of app logic and data

App store the ECS World, Resources, Schedule, and Executor. They also store the "run" function of the App, which by default executes the App schedule once. Apps are constructed using the builder pattern.

Example

Here is a simple "Hello World" Bevy app:

use bevy_app::prelude::*;
use bevy_ecs::prelude::*;

fn main() {
   App::build()
       .add_system(hello_world_system.system())
       .run();
}

fn hello_world_system() {
   println!("hello world");
}

Fields

world: Worldresources: Resourcesrunner: Box<dyn Fn(App) + 'static, Global>schedule: Schedule

Implementations

impl App

pub fn build() -> AppBuilder

pub fn update(&mut self)

pub fn run(self)

Trait Implementations

impl Default for App

Auto Trait Implementations

impl !RefUnwindSafe for App[src]

impl !Send for App[src]

impl !Sync for App[src]

impl Unpin for App[src]

impl !UnwindSafe for App[src]

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> Downcast for T where
    T: Any

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

impl<T> FromResources for T where
    T: Default

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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>,