Trait bevy_asset_loader::mapped::MapKey
source · pub trait MapKey {
// Required method
fn from_asset_path(path: &AssetPath<'_>) -> Self;
}Expand description
A type that can be used as key for mapped asset collection.
§String and Box<str>
Both String and Box<str> implements MapKey by using
the path of the asset as the key.
§Key collision
Following the implementation of the MapKey trait, key collisions may happen,
resulting in some assets not being loaded.
This is up to the user to ensure that there are no collisions.
Required Methods§
sourcefn from_asset_path(path: &AssetPath<'_>) -> Self
fn from_asset_path(path: &AssetPath<'_>) -> Self
Creates the key from the path of the asset.
Object Safety§
This trait is not object safe.