Skip to main content

DirectAssetAccessExt

Trait DirectAssetAccessExt 

Source
pub trait DirectAssetAccessExt {
    // Required methods
    fn add_asset<A>(&mut self, asset: impl Into<A>) -> Handle<A>
       where A: Asset;
    fn load_asset<'a, A>(&self, path: impl Into<AssetPath<'a>>) -> Handle<A>
       where A: Asset;
    fn load_builder(&self) -> LoadBuilder<'_>;
}
Expand description

An extension trait for methods for working with assets directly from a World.

Required Methods§

Source

fn add_asset<A>(&mut self, asset: impl Into<A>) -> Handle<A>
where A: Asset,

Insert an asset similarly to Assets::add.

Source

fn load_asset<'a, A>(&self, path: impl Into<AssetPath<'a>>) -> Handle<A>
where A: Asset,

Load an asset similarly to AssetServer::load.

Source

fn load_builder(&self) -> LoadBuilder<'_>

Creates a new LoadBuilder similar to AssetServer::load_builder.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§