Struct legion::world::Duplicate [−][src]
A Merger
which clones entities from the source world into the destination,
potentially performing data transformations in the process.
Implementations
impl Duplicate
[src]
pub fn new() -> Self
[src]
Creates a new duplicate merger.
pub fn register_copy<T: Component + Copy>(&mut self)
[src]
Allows the merger to copy the given component into the destination world.
pub fn register_clone<T: Component + Clone>(&mut self)
[src]
Allows the merger to clone the given component into the destination world.
pub fn register_convert<Source: Component, Target: Component, F: FnMut(&Source) -> Target + 'static>(
&mut self,
convert: F
)
[src]
&mut self,
convert: F
)
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<'_>)>
)
[src]
&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
impl Default for Duplicate
[src]
impl Merger for Duplicate
[src]
fn convert_layout(&mut self, source_layout: EntityLayout) -> EntityLayout
[src]
fn merge_archetype(
&mut self,
src_entity_range: Range<usize>,
src_arch: &Archetype,
src_components: &Components,
dst: &mut ArchetypeWriter<'_>
)
[src]
&mut self,
src_entity_range: Range<usize>,
src_arch: &Archetype,
src_components: &Components,
dst: &mut ArchetypeWriter<'_>
)
fn prefers_new_archetype() -> bool
[src]
fn entity_map(&mut self) -> EntityRewrite
[src]
fn assign_id(&mut self, existing: Entity, allocator: &mut Allocate) -> Entity
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Duplicate
impl !Send for Duplicate
impl !Sync for Duplicate
impl Unpin for Duplicate
impl !UnwindSafe for Duplicate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,