Struct legion::world::Duplicate[][src]

pub struct Duplicate { /* fields omitted */ }

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]

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.