pub struct Spawn<B: Bundle>(pub B);Expand description
A wrapper over a Bundle indicating that an entity should be spawned with that Bundle.
This is intended to be used for hierarchical spawning via traits like SpawnableList and SpawnRelated.
Also see the children and related macros that abstract over the Spawn API.
let mut world = World::new();
world.spawn((
Name::new("Root"),
Children::spawn((
Spawn(Name::new("Child1")),
Spawn((
Name::new("Child2"),
Children::spawn(Spawn(Name::new("Grandchild"))),
))
)),
));Tuple Fields§
§0: BTrait Implementations§
Source§impl<R: Relationship, B: Bundle> SpawnableList<R> for Spawn<B>
impl<R: Relationship, B: Bundle> SpawnableList<R> for Spawn<B>
Auto Trait Implementations§
impl<B> Freeze for Spawn<B>where
B: Freeze,
impl<B> RefUnwindSafe for Spawn<B>where
B: RefUnwindSafe,
impl<B> Send for Spawn<B>
impl<B> Sync for Spawn<B>
impl<B> Unpin for Spawn<B>where
B: Unpin,
impl<B> UnwindSafe for Spawn<B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.