Skip to main content

ExtractResource

Trait ExtractResource 

pub trait ExtractResource<L, F = ()>: Resource
where L: AppLabel,
{ type Source: Resource; // Required method fn extract_resource(source: &Self::Source) -> Self; }
Expand description

Describes how a resource gets extracted for processing.

Therefore the resource is transferred from the “main world” into the “sub 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§

type Source: Resource

Required Methods§

fn extract_resource(source: &Self::Source) -> Self

Defines how the resource 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§