pub struct AssetPlugin<B, T: Asset<B>> { /* private fields */ }Expand description
Plugin that drives the source → processed conversion pipeline for a single
asset type T.
B is the backend passed to Asset::upload and is intentionally
generic — it need not be a GPU backend:
- GPU assets:
B= your graphics backend (e.g. wgpuDevice). - CPU-only / audio / other:
B = ()or any other service type.
Registering AssetPlugin::<B, T>::new() will:
- Insert an
Assets<T::Source>resource for raw source assets. - Insert a
ProcessedAssets<T>resource for the converted results. - Add a system on
SystemStage::AssetSyncthat flushes the dirty queue each tick, callingAsset::uploadfor every pending entry.
The sync system waits silently until both B and all of T’s
Dependencies are present as resources before processing any uploads.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<B, T> Freeze for AssetPlugin<B, T>
impl<B, T> RefUnwindSafe for AssetPlugin<B, T>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<B, T> Send for AssetPlugin<B, T>where
B: Send,
impl<B, T> Sync for AssetPlugin<B, T>where
B: Sync,
impl<B, T> Unpin for AssetPlugin<B, T>
impl<B, T> UnsafeUnpin for AssetPlugin<B, T>
impl<B, T> UnwindSafe for AssetPlugin<B, T>where
B: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more