Trait 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>,
    );
}

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>, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Compose for &'static str

Source§

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 ()

Source§

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

Source§

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, C3: Compose> Compose for (C1, C2, C3)

Source§

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>, )

Implementors§