pub trait ConditionalInsertComponentsExt {
Show 13 methods fn insert_if<C: Component>(
        &mut self,
        condition: bool,
        component: C
    ) -> &mut Self; fn insert_if_lazy<C: Component>(
        &mut self,
        condition: bool,
        component: impl FnOnce() -> C
    ) -> &mut Self; fn insert_if_else<C: Component, D: Component>(
        &mut self,
        condition: bool,
        component: C,
        else_component: D
    ) -> &mut Self; fn insert_bundle_if<B: Bundle>(
        &mut self,
        condition: bool,
        bundle: B
    ) -> &mut Self; fn insert_bundle_if_lazy<B: Bundle>(
        &mut self,
        condition: bool,
        bundle: impl FnOnce() -> B
    ) -> &mut Self; fn insert_bundle_if_else<A: Bundle, B: Bundle>(
        &mut self,
        condition: bool,
        bundle: A,
        else_bundle: B
    ) -> &mut Self; fn insert_bundle_if_else_lazy<A: Bundle, B: Bundle>(
        &mut self,
        condition: bool,
        bundle: impl FnOnce() -> A,
        else_bundle: impl FnOnce() -> B
    ) -> &mut Self; fn insert_some<C: Component>(
        &mut self,
        optional_component: Option<C>
    ) -> &mut Self; fn insert_some_or<C: Component, D: Component>(
        &mut self,
        optional_component: Option<C>,
        otherwise: D
    ) -> &mut Self; fn insert_some_or_else<C: Component, D: Component>(
        &mut self,
        optional_component: Option<C>,
        otherwise: impl FnOnce() -> D
    ) -> &mut Self; fn insert_bundle_some<B: Bundle>(
        &mut self,
        optional_bundle: Option<B>
    ) -> &mut Self; fn insert_bundle_some_or<A: Bundle, B: Bundle>(
        &mut self,
        optional_bundle: Option<A>,
        else_bundle: B
    ) -> &mut Self; fn insert_bundle_some_or_else<A: Bundle, B: Bundle>(
        &mut self,
        optional_bundle: Option<A>,
        otherwise: impl FnOnce() -> B
    ) -> &mut Self;
}

Required Methods

Implementations on Foreign Types

if condition, add a [Component] to the entity

if condition, add a [Bundle] to the entity

if condition, add a [Component] to the entity else add other [Component] to the entity

if condition, add a [Bundle] to the entity else add other [Bundle] to the entity

If present, insert the inner value of optional_component

If present, insert the inner value of optional_component otherwise insert the component returned by otherwise

If present, insert the inner value of optional_bundle

If present, insert the inner value of optional_bundle otherwise insert the component returned by otherwise

If condition, compute a component from a closure and insert it

If condition, compute a bundle from a closure and insert it

If condition, compute a component from bundle_fn and insert it otherwise compute a bundle from else_bundle_fn and insert it

Insert inner value of optional_component or if none, insert otherwise

Insert inner value of optional_bundle or if none, insert otherwise

if condition, add a [Component] to the entity

if condition, add a [Bundle] to the entity

if condition, add a [Component] to the entity else add other [Component] to the entity

if condition, add a [Bundle] to the entity else add other [Bundle] to the entity

If present, insert the inner value of optional_component

If present, insert the inner value of optional_component otherwise insert the component returned by otherwise

If present, insert the inner value of optional_bundle

If present, insert the inner value of optional_bundle otherwise insert the component returned by otherwise

If condition, compute a component from a closure and insert it

If condition, compute a bundle from a closure and insert it

If condition, compute a component from bundle_fn and insert it otherwise compute a bundle from else_bundle_fn and insert it

Insert inner value of optional_component or if none, insert otherwise

Insert inner value of optional_bundle or if none, insert otherwise

Implementors