From 0bb217d53f9c09ad5d64f57396b2d35e83d1736c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 25 May 2019 09:38:30 +0100 Subject: [PATCH] Added docs to assets::load_map Former-commit-id: 50397d3c5d8c30ea392b784d9309d0e2ecb28f73 --- common/src/assets/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/src/assets/mod.rs b/common/src/assets/mod.rs index 00c65adfb3..f691f296fe 100644 --- a/common/src/assets/mod.rs +++ b/common/src/assets/mod.rs @@ -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::("core.ui.backgrounds.city").unwrap(); +/// ``` pub fn load_map A>( specifier: &str, f: F,