Struct legion::world::Duplicate [−][src]
pub struct Duplicate { /* fields omitted */ }
Expand description
A Merger
which clones entities from the source world into the destination,
potentially performing data transformations in the process.
Implementations
Allows the merger to copy the given component into the destination world.
Allows the merger to clone the given component into the destination world.
Allows the merger to clone the given component into the destination world with a custom clone function.
pub fn register_convert_raw(
&mut self,
src_type: ComponentTypeId,
dst_type: ComponentTypeId,
constructor: fn() -> Box<dyn UnknownComponentStorage>,
duplicate_fn: Box<dyn FnMut(Range<usize>, &Archetype, &dyn UnknownComponentStorage, &mut ArchetypeWriter<'_>)>
)
pub fn register_convert_raw(
&mut self,
src_type: ComponentTypeId,
dst_type: ComponentTypeId,
constructor: fn() -> Box<dyn UnknownComponentStorage>,
duplicate_fn: Box<dyn FnMut(Range<usize>, &Archetype, &dyn UnknownComponentStorage, &mut ArchetypeWriter<'_>)>
)
Allows the merger to clone the given component into the destination world with a custom clone function.
Trait Implementations
Calculates the destination entity layout for the given source layout.
fn merge_archetype(
&mut self,
src_entity_range: Range<usize>,
src_arch: &Archetype,
src_components: &Components,
dst: &mut ArchetypeWriter<'_>
)
fn merge_archetype(
&mut self,
src_entity_range: Range<usize>,
src_arch: &Archetype,
src_components: &Components,
dst: &mut ArchetypeWriter<'_>
)
Merges an archetype from the source world into the destination world.
Indicates if the merger prefers to merge into a new empty archetype.
Indicates how the merger wishes entity IDs to be adjusted while cloning a world.
Auto Trait Implementations
impl !RefUnwindSafe for Duplicate
impl !UnwindSafe for Duplicate
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more