SpawnableList

Trait SpawnableList 

Source
pub trait SpawnableList<R>: Sized {
    // Required methods
    fn spawn(this: MovingPtr<'_, Self>, world: &mut World, entity: Entity);
    fn size_hint(&self) -> usize;
}
Expand description

A spawn-able list of changes to a given World and relative to a given Entity. This is generally used for spawning “related” entities, such as children.

Required Methods§

Source

fn spawn(this: MovingPtr<'_, Self>, world: &mut World, entity: Entity)

Spawn this list of changes in a given World and relative to a given Entity. This is generally used for spawning “related” entities, such as children.

Source

fn size_hint(&self) -> usize

Returns a size hint, which is used to reserve space for this list in a RelationshipTarget. This should be less than or equal to the actual size of the list. When in doubt, just use 0.

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<R: Relationship> SpawnableList<R> for ()

Source§

fn spawn(_this: MovingPtr<'_, Self>, _world: &mut World, _entity: Entity)
where Self: Sized,

Source§

fn size_hint(&self) -> usize

Source§

impl<R: Relationship, B: Bundle<Effect: NoBundleEffect>> SpawnableList<R> for Vec<B>

Source§

fn spawn(ptr: MovingPtr<'_, Self>, world: &mut World, entity: Entity)

Source§

fn size_hint(&self) -> usize

Source§

impl<R: Relationship, P: SpawnableList<R>> SpawnableList<R> for (P₁, P₂, …, Pₙ)

This trait is implemented for tuples up to 13 items long.

Source§

fn spawn(_this: MovingPtr<'_, Self>, _world: &mut World, _entity: Entity)
where Self: Sized,

Source§

fn size_hint(&self) -> usize

Implementors§

Source§

impl<R: Relationship> SpawnableList<R> for WithOneRelated

Source§

impl<R: Relationship, B: Bundle> SpawnableList<R> for Spawn<B>

Source§

impl<R: Relationship, F: FnOnce(&mut RelatedSpawner<'_, R>) + Send + Sync + 'static> SpawnableList<R> for SpawnWith<F>

Source§

impl<R: Relationship, I: Iterator<Item = Entity>> SpawnableList<R> for WithRelated<I>

Source§

impl<R: Relationship, I: Iterator<Item = B> + Send + Sync + 'static, B: Bundle> SpawnableList<R> for SpawnIter<I>