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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl DslBundle for ()

source§

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

source§

impl<T, D, F> DslBundle for ReflectDsl<T, D, F>
where T: Bundle + Default + Struct, D: DslBundle, F: Format,

source§

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

Implementors§