Struct bevy::prelude::AppBuilder[]

pub struct AppBuilder {
    pub app: App,
}

Configure Apps using the builder pattern

Fields

app: App

Implementations

impl AppBuilder

pub fn empty() -> AppBuilder

pub fn run(&mut self)

pub fn world(&mut self) -> &World

pub fn world_mut(&mut self) -> &mut World

pub fn set_world(&mut self, world: World) -> &mut AppBuilder

pub fn add_stage<S>(
    &mut self,
    label: impl StageLabel,
    stage: S
) -> &mut AppBuilder where
    S: Stage

pub fn add_stage_after<S>(
    &mut self,
    target: impl StageLabel,
    label: impl StageLabel,
    stage: S
) -> &mut AppBuilder where
    S: Stage

pub fn add_stage_before<S>(
    &mut self,
    target: impl StageLabel,
    label: impl StageLabel,
    stage: S
) -> &mut AppBuilder where
    S: Stage

pub fn add_startup_stage<S>(
    &mut self,
    label: impl StageLabel,
    stage: S
) -> &mut AppBuilder where
    S: Stage

pub fn add_startup_stage_after<S>(
    &mut self,
    target: impl StageLabel,
    label: impl StageLabel,
    stage: S
) -> &mut AppBuilder where
    S: Stage

pub fn add_startup_stage_before<S>(
    &mut self,
    target: impl StageLabel,
    label: impl StageLabel,
    stage: S
) -> &mut AppBuilder where
    S: Stage

pub fn stage<T, F>(
    &mut self,
    label: impl StageLabel,
    func: F
) -> &mut AppBuilder where
    T: Stage,
    F: FnOnce(&mut T) -> &mut T, 

pub fn add_system(
    &mut self,
    system: impl Into<SystemDescriptor>
) -> &mut AppBuilder

pub fn add_system_set(&mut self, system_set: SystemSet) -> &mut AppBuilder

pub fn add_system_to_stage(
    &mut self,
    stage_label: impl StageLabel,
    system: impl Into<SystemDescriptor>
) -> &mut AppBuilder

pub fn add_system_set_to_stage(
    &mut self,
    stage_label: impl StageLabel,
    system_set: SystemSet
) -> &mut AppBuilder

pub fn add_startup_system(
    &mut self,
    system: impl Into<SystemDescriptor>
) -> &mut AppBuilder

pub fn add_startup_system_to_stage(
    &mut self,
    stage_label: impl StageLabel,
    system: impl Into<SystemDescriptor>
) -> &mut AppBuilder

pub fn add_state<T>(&mut self, initial: T) -> &mut AppBuilder where
    T: Component + Debug + Clone + Eq + Hash

Adds a new State with the given initial value. This inserts a new State<T> resource and adds a new “driver” to CoreStage::Update. Each stage that uses State<T> for system run criteria needs a driver. If you need to use your state in a different stage, consider using Self::add_state_to_stage or manually adding State::get_driver to additional stages you need it in.

pub fn add_state_to_stage<T>(
    &mut self,
    stage: impl StageLabel,
    initial: T
) -> &mut AppBuilder where
    T: Component + Debug + Clone + Eq + Hash

Adds a new State with the given initial value. This inserts a new State<T> resource and adds a new “driver” to the given stage. Each stage that uses State<T> for system run criteria needs a driver. If you need to use your state in more than one stage, consider manually adding State::get_driver to the stages you need it in.

pub fn add_default_stages(&mut self) -> &mut AppBuilder

pub fn add_event<T>(&mut self) -> &mut AppBuilder where
    T: Component

Setup the application to manage events of type T.

This is done by adding a Resource of type Events::<T>, and inserting a Events::<T>::update_system system into CoreStage::First.

pub fn insert_resource<T>(&mut self, resource: T) -> &mut AppBuilder where
    T: Component

Inserts a resource to the current App and overwrites any resource previously added of the same type.

pub fn insert_non_send_resource<T>(&mut self, resource: T) -> &mut AppBuilder where
    T: 'static, 

pub fn init_resource<R>(&mut self) -> &mut AppBuilder where
    R: FromWorld + Send + Sync + 'static, 

pub fn init_non_send_resource<R>(&mut self) -> &mut AppBuilder where
    R: FromWorld + 'static, 

pub fn set_runner(&mut self, run_fn: impl Fn(App) + 'static) -> &mut AppBuilder

pub fn add_plugin<T>(&mut self, plugin: T) -> &mut AppBuilder where
    T: Plugin

pub fn add_plugins<T>(&mut self, group: T) -> &mut AppBuilder where
    T: PluginGroup

pub fn add_plugins_with<T, F>(&mut self, group: T, func: F) -> &mut AppBuilder where
    T: PluginGroup,
    F: FnOnce(&mut PluginGroupBuilder) -> &mut PluginGroupBuilder

pub fn register_component(
    &mut self,
    descriptor: ComponentDescriptor
) -> &mut AppBuilder

Registers a new component using the given ComponentDescriptor. Components do not need to be manually registered. This just provides a way to override default configuration. Attempting to register a component with a type that has already been used by World will result in an error.

See World::register_component

pub fn register_type<T>(&mut self) -> &mut AppBuilder where
    T: GetTypeRegistration

Trait Implementations

impl AddAsset for AppBuilder

impl Default for AppBuilder

impl DynamicPluginExt for AppBuilder

Auto Trait Implementations

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> Downcast<T> for T

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

impl<T> FromWorld 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<T> Upcast<T> for T

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