Struct hecs_hierarchy::TreeBuilder[][src]

pub struct TreeBuilder<'a, T> { /* fields omitted */ }
Expand description

A wrapper to help spawn trees more ergonomically

Example

struct TreeMarker;

let mut world = World::new();
let builder = TreeBuilder::<TreeMarker>::new(&mut world);
let tree_root = builder
    .spawn_tree(("root",))
    .attach_new(("child 1",))
    .attach({
        builder
            .spawn_tree(("child 2",))
            .attach_new(("child 2.1",))
            .attach_new(("child 2.2",))
            .entity()
    })
    .entity();

Implementations

Spawns an entity in the world wrapped in this TreeBuilder, without actually building a tree or attaching it to anything.

Spawns a tree root in the world wrapped in this TreeBuilder, returning a TreeBuilderAt that allows spawning children under it.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.