Added docs to assets::load_map

Former-commit-id: 50397d3c5d8c30ea392b784d9309d0e2ecb28f73
This commit is contained in:
Joshua Barretto 2019-05-25 09:38:30 +01:00
parent 8348633a0f
commit 0bb217d53f

View File

@ -36,6 +36,15 @@ lazy_static! {
RwLock::new(HashMap::new());
}
/// Function used to load assets. Permits manipulating the loaded asset with a mapping function.
/// Loaded assets are cached in a global singleton hashmap.
/// Example usage:
/// ```no_run
/// use image::DynamicImage;
/// use veloren_common::assets;
///
/// let my_image = assets::load::<DynamicImage>("core.ui.backgrounds.city").unwrap();
/// ```
pub fn load_map<A: Asset + 'static, F: FnOnce(A) -> A>(
specifier: &str,
f: F,