Struct bevy_app::AppBuilder [−][src]
Configure Apps using the builder pattern
Fields
app: App
Implementations
impl AppBuilder
[src]
pub fn empty() -> AppBuilder
[src]
pub fn run(&mut self)
[src]
pub fn world(&mut self) -> &World
[src]
pub fn world_mut(&mut self) -> &mut World
[src]
pub fn set_world(&mut self, world: World) -> &mut Self
[src]
pub fn add_stage<S: Stage>(
&mut self,
label: impl StageLabel,
stage: S
) -> &mut Self
[src]
&mut self,
label: impl StageLabel,
stage: S
) -> &mut Self
pub fn add_stage_after<S: Stage>(
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
[src]
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
pub fn add_stage_before<S: Stage>(
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
[src]
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
pub fn add_startup_stage<S: Stage>(
&mut self,
label: impl StageLabel,
stage: S
) -> &mut Self
[src]
&mut self,
label: impl StageLabel,
stage: S
) -> &mut Self
pub fn add_startup_stage_after<S: Stage>(
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
[src]
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
pub fn add_startup_stage_before<S: Stage>(
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
[src]
&mut self,
target: impl StageLabel,
label: impl StageLabel,
stage: S
) -> &mut Self
pub fn stage<T: Stage, F: FnOnce(&mut T) -> &mut T>(
&mut self,
label: impl StageLabel,
func: F
) -> &mut Self
[src]
&mut self,
label: impl StageLabel,
func: F
) -> &mut Self
pub fn add_system(&mut self, system: impl Into<SystemDescriptor>) -> &mut Self
[src]
pub fn add_system_set(&mut self, system_set: SystemSet) -> &mut Self
[src]
pub fn add_system_to_stage(
&mut self,
stage_label: impl StageLabel,
system: impl Into<SystemDescriptor>
) -> &mut Self
[src]
&mut self,
stage_label: impl StageLabel,
system: impl Into<SystemDescriptor>
) -> &mut Self
pub fn add_system_set_to_stage(
&mut self,
stage_label: impl StageLabel,
system_set: SystemSet
) -> &mut Self
[src]
&mut self,
stage_label: impl StageLabel,
system_set: SystemSet
) -> &mut Self
pub fn add_startup_system(
&mut self,
system: impl Into<SystemDescriptor>
) -> &mut Self
[src]
&mut self,
system: impl Into<SystemDescriptor>
) -> &mut Self
pub fn add_startup_system_to_stage(
&mut self,
stage_label: impl StageLabel,
system: impl Into<SystemDescriptor>
) -> &mut Self
[src]
&mut self,
stage_label: impl StageLabel,
system: impl Into<SystemDescriptor>
) -> &mut Self
pub fn add_state<T>(&mut self, initial: T) -> &mut Self where
T: Component + Debug + Clone + Eq + Hash,
[src]
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 Self where
T: Component + Debug + Clone + Eq + Hash,
[src]
&mut self,
stage: impl StageLabel,
initial: T
) -> &mut Self 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 Self
[src]
pub fn add_event<T>(&mut self) -> &mut Self where
T: Component,
[src]
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 Self where
T: Component,
[src]
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 Self where
T: 'static,
[src]
T: 'static,
pub fn init_resource<R>(&mut self) -> &mut Self where
R: FromWorld + Send + Sync + 'static,
[src]
R: FromWorld + Send + Sync + 'static,
pub fn init_non_send_resource<R>(&mut self) -> &mut Self where
R: FromWorld + 'static,
[src]
R: FromWorld + 'static,
pub fn set_runner(&mut self, run_fn: impl Fn(App) + 'static) -> &mut Self
[src]
pub fn add_plugin<T>(&mut self, plugin: T) -> &mut Self where
T: Plugin,
[src]
T: Plugin,
pub fn add_plugins<T: PluginGroup>(&mut self, group: T) -> &mut Self
[src]
pub fn add_plugins_with<T, F>(&mut self, group: T, func: F) -> &mut Self where
T: PluginGroup,
F: FnOnce(&mut PluginGroupBuilder) -> &mut PluginGroupBuilder,
[src]
T: PluginGroup,
F: FnOnce(&mut PluginGroupBuilder) -> &mut PluginGroupBuilder,
pub fn register_component(
&mut self,
descriptor: ComponentDescriptor
) -> &mut Self
[src]
&mut self,
descriptor: ComponentDescriptor
) -> &mut Self
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.
pub fn register_type<T: GetTypeRegistration>(&mut self) -> &mut Self
[src]
Trait Implementations
impl Default for AppBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AppBuilder
impl !Send for AppBuilder
impl !Sync for AppBuilder
impl Unpin for AppBuilder
impl !UnwindSafe for AppBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> From<T> for T
[src]
impl<T> FromWorld for T where
T: Default,
[src]
T: Default,
pub fn from_world(_world: &mut World) -> T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,