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§

source

fn from_asset_path(path: &AssetPath<'_>) -> Self

Creates the key from the path of the asset.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MapKey for Box<str>

source§

fn from_asset_path(path: &AssetPath<'_>) -> Self

source§

impl MapKey for String

source§

fn from_asset_path(path: &AssetPath<'_>) -> Self

Implementors§