Trait bevy_compose::compose::Compose

source ·
pub trait Compose: Send + Sync + 'static {
    type State: Send + Sync + 'static;

    // Required methods
    fn build(
        &mut self,
        world: &mut World,
        children: &mut Vec<Entity>
    ) -> Self::State;
    fn rebuild(
        &mut self,
        target: &mut Self,
        state: &mut Self::State,
        world: &mut World,
        children: &mut Vec<Entity>
    );

    // Provided method
    fn remove(&mut self, _state: &mut Self::State) { ... }
}

Required Associated Types§

source

type State: Send + Sync + 'static

Required Methods§

source

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

Provided Methods§

source

fn remove(&mut self, _state: &mut Self::State)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Compose for &'static str

§

type State = Entity

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl Compose for ()

§

type State = ()

source§

fn build( &mut self, _world: &mut World, _children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, _target: &mut Self, _state: &mut Self::State, _world: &mut World, _children: &mut Vec<Entity> )

source§

impl Compose for String

§

type State = Entity

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose> Compose for (C1, C2)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose, C3: Compose> Compose for (C1, C2, C3)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State, <C3 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose, C3: Compose, C4: Compose> Compose for (C1, C2, C3, C4)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State, <C3 as Compose>::State, <C4 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose, C3: Compose, C4: Compose, C5: Compose> Compose for (C1, C2, C3, C4, C5)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State, <C3 as Compose>::State, <C4 as Compose>::State, <C5 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose, C3: Compose, C4: Compose, C5: Compose, C6: Compose> Compose for (C1, C2, C3, C4, C5, C6)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State, <C3 as Compose>::State, <C4 as Compose>::State, <C5 as Compose>::State, <C6 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose, C3: Compose, C4: Compose, C5: Compose, C6: Compose, C7: Compose> Compose for (C1, C2, C3, C4, C5, C6, C7)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State, <C3 as Compose>::State, <C4 as Compose>::State, <C5 as Compose>::State, <C6 as Compose>::State, <C7 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C1: Compose, C2: Compose, C3: Compose, C4: Compose, C5: Compose, C6: Compose, C7: Compose, C8: Compose> Compose for (C1, C2, C3, C4, C5, C6, C7, C8)

§

type State = (<C1 as Compose>::State, <C2 as Compose>::State, <C3 as Compose>::State, <C4 as Compose>::State, <C5 as Compose>::State, <C6 as Compose>::State, <C7 as Compose>::State, <C8 as Compose>::State)

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

source§

impl<C: Compose> Compose for Option<C>

§

type State = Option<<C as Compose>::State>

source§

fn build( &mut self, world: &mut World, children: &mut Vec<Entity> ) -> Self::State

source§

fn rebuild( &mut self, target: &mut Self, state: &mut Self::State, world: &mut World, children: &mut Vec<Entity> )

Implementors§

source§

impl Compose for Lazy

source§

impl<C> Compose for Memo<C>
where C: Compose,

§

type State = (u64, <C as Compose>::State)

source§

impl<C: Compose> Compose for Flex<C>

§

type State = (Entity, <C as Compose>::State, Vec<Entity>)