Skip to main content

DslBundle

Trait DslBundle 

Source
pub trait DslBundle: Default {
    // Required method
    fn insert(&mut self, cmds: &mut EntityCommands<'_, '_, '_>);

    // Provided method
    fn node(
        &mut self,
        cmds: &mut EntityCommands<'_, '_, '_>,
        f: impl FnOnce(&mut ChildBuilder<'_, '_, '_>),
    ) { ... }
}
Expand description

The type used in a dsl! macro to create bundles to spawn when creating the entity tree.

Default is used as the initial value for each entity.

Required Methods§

Source

fn insert(&mut self, cmds: &mut EntityCommands<'_, '_, '_>)

Add given Bundle to the entity.

Provided Methods§

Source

fn node( &mut self, cmds: &mut EntityCommands<'_, '_, '_>, f: impl FnOnce(&mut ChildBuilder<'_, '_, '_>), )

Spawn the entity as a parent of other entities.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DslBundle for ()

Source§

fn insert(&mut self, _: &mut EntityCommands<'_, '_, '_>)

Implementors§