pub trait RenderAsset:
Send
+ Sync
+ 'static
+ Sized {
type SourceAsset: Asset + Clone;
type Params: SystemParam;
// Required method
fn prepare(
asset: Self::SourceAsset,
params: &mut SystemParamItem<'_, '_, Self::Params>,
) -> Result<Self, PrepareAssetError<Self::SourceAsset>>;
// Provided method
fn label(&self) -> &str { ... }
}Expand description
Trait that describes a GPU asset extracted from a CPU asset that implements the [bevy::prelude::Asset] trait. The GPU asset is prepared from the CPU asset using the render-world system params, and can fail with a retry or fatal error.
Required Associated Types§
type SourceAsset: Asset + Clone
type Params: SystemParam
Required Methods§
Sourcefn prepare(
asset: Self::SourceAsset,
params: &mut SystemParamItem<'_, '_, Self::Params>,
) -> Result<Self, PrepareAssetError<Self::SourceAsset>>
fn prepare( asset: Self::SourceAsset, params: &mut SystemParamItem<'_, '_, Self::Params>, ) -> Result<Self, PrepareAssetError<Self::SourceAsset>>
Prepare the GPU asset from the CPU source [bevy::prelude::Asset] using the render-world system params.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.