Skip to main content

ExtractInstance

Trait ExtractInstance 

Source
pub trait ExtractInstance<L>:
    Sized
    + Send
    + Sync
    + 'static
where L: AppLabel,
{ type QueryData: ReadOnlyQueryData; type QueryFilter: QueryFilter; // Required method fn extract( item: <Self::QueryData as QueryData>::Item<'_, '_>, ) -> Option<Self>; }
Expand description

Describes how to extract data needed for processing from a component or components.

Before processing, any applicable components will be transferred from the main world to the sub world in the ExtractSchedule step.

This is essentially the same as ExtractComponent, but higher-performance because it avoids the ECS overhead.

Required Associated Types§

Source

type QueryData: ReadOnlyQueryData

ECS ReadOnlyQueryData to fetch the components to extract.

Source

type QueryFilter: QueryFilter

Filters the entities with additional constraints.

Required Methods§

Source

fn extract(item: <Self::QueryData as QueryData>::Item<'_, '_>) -> Option<Self>

Defines how the component is transferred into the “sub world”.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§