pub trait ExtractResource<F = ()>: Resource {
type Source: Resource;
// Required method
fn extract_resource(source: &Self::Source) -> Self;
}Expand description
Describes how a resource gets extracted for rendering.
Therefore the resource is transferred from the “main world” into the “render world”
in the ExtractSchedule step.
The marker type F is only used as a way to bypass the orphan rules. To
implement the trait for a foreign type you can use a local type as the
marker, e.g. the type of the plugin that calls ExtractResourcePlugin.
Required Associated Types§
Required Methods§
Sourcefn extract_resource(source: &Self::Source) -> Self
fn extract_resource(source: &Self::Source) -> Self
Defines how the resource is transferred into the “render world”.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".