![]() # Objective - Sometimes, it is useful to get a `Handle<T>` from an `AssetId<T>`. For example, when iterating `Assets` to find a specific asset. So much so that it's possible to do so with `AssetServer::get_id_handle` - However, `AssetServer::get_id_handle` doesn't work with assets directly added to `Assets` using `Assets::add`. - Fixes #12087 ## Solution - Add `Assets::get_strong_handle` to convert an `AssetId` into an `Handle` - Document `AssetServer::get_id_handle` to explain its limitation and point to `get_strong_handle`. - Add a test for `get_strong_handle` - Add a `duplicate_handles` field to `Assets` to avoid dropping assets with a live handle generated by `get_strong_handle` (more reference counting yay…) - Fix typos in `Assets` docs --- ## Changelog - Add `Assets::get_strong_handle` to convert an `AssetId` into an `Handle` |
||
---|---|---|
.. | ||
io | ||
processor | ||
server | ||
assets.rs | ||
event.rs | ||
folder.rs | ||
handle.rs | ||
id.rs | ||
lib.rs | ||
loader.rs | ||
meta.rs | ||
path.rs | ||
reflect.rs | ||
saver.rs | ||
transformer.rs |