pub struct TreeBuilderClone<T> { /* private fields */ }
Expand description

Cloneable version of the crate::TreeBuilder

Implementations§

source§

impl<T: Component> TreeBuilderClone<T>

source

pub fn new() -> Self

Construct a new empty tree

source

pub fn reserve(&self, world: &impl GenericWorld) -> Entity

Reserve the entity which this node will spawn

source

pub fn spawn(self, world: &mut World) -> Entity

Spawn the whole tree into the world

source

pub fn spawn_deferred( self, world: &impl GenericWorld, cmd: &mut CommandBuffer ) -> Entity

Spawn the whole tree into a commandbuffer. The world is required for reserving entities.

source

pub fn add(&mut self, component: impl Component + Clone) -> &mut Self

Add a component to the root

source

pub fn add_all(&mut self, component: impl Component + Clone) -> &mut Self

source

pub fn add_bundle(&mut self, bundle: impl DynamicBundleClone) -> &mut Self

Add a bundle to the root

source

pub fn attach_tree(&mut self, child: Self) -> &mut Self

Atttach a new subtree

source

pub fn attach(&mut self, child: impl Into<Self>) -> &mut Self

Attach a new leaf

source

pub fn attach_move(self, child: impl Into<Self>) -> Self

Consuming variant of Self::attach.

This is useful for nesting to alleviate the need to save an intermediate builder

source

pub fn attach_tree_move(self, child: impl Into<Self>) -> Self

Consuming variant of Self::attach_tree. This is useful for nesting to alleviate the need to save an intermediate builder

source

pub fn children(&self) -> &[Self]

Get a reference to the deferred tree builder’s children.

source

pub fn root(&self) -> &EntityBuilderClone

Get a reference to the deferred tree builder’s root.

source

pub fn root_mut(&mut self) -> &mut EntityBuilderClone

Get a mutable reference to the deferred tree builder’s builder.

source

pub fn children_mut(&mut self) -> &mut Vec<TreeBuilderClone<T>>

Get a mutable reference to the tree builder clone’s children.

Trait Implementations§

source§

impl<T> Clone for TreeBuilderClone<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B: DynamicBundleClone, T: Component> From<B> for TreeBuilderClone<T>

source§

fn from(bundle: B) -> Self

Converts to this type from the input type.
source§

impl<T: Component> From<TreeBuilderClone<T>> for TreeBuilder<T>

source§

fn from(tree: TreeBuilderClone<T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for TreeBuilderClone<T>
where T: RefUnwindSafe,

§

impl<T> Send for TreeBuilderClone<T>
where T: Send,

§

impl<T> Sync for TreeBuilderClone<T>
where T: Sync,

§

impl<T> Unpin for TreeBuilderClone<T>
where T: Unpin,

§

impl<T> UnwindSafe for TreeBuilderClone<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Component for T
where T: Send + Sync + 'static,