![]() # Objective - `LoadContext::labeled_asset_scope` cannot return errors back to the asset loader. This means users that need errors need to fall back to using the raw `begin_labeled_asset` and `add_loaded_labeled_asset`, which is more error-prone. ## Solution - Allow returning a (generic) error from `labeled_asset_scope`. - This has the unfortunate side effect that closures which don't return any errors need to A) return Ok at the end, B) need to specify an error type (e.g., `()`). --- ## Showcase ```rust // impl AssetLoader for MyLoader let handle = load_context.labeled_asset_scope("MySubasset", |mut load_context| { if !some_precondition { return Err(ThingsDontMakeSenseError); } let handle = load_context.add_labeled_asset("MySubasset/Other", SomeOtherThing(456)); Ok(Something{ id: 123, handle }) })?; ``` |
||
---|---|---|
.. | ||
migration-guides | ||
release-notes | ||
migration_guides_template.md | ||
migration_guides.md | ||
README.md | ||
release_notes_template.md | ||
release_notes.md |
Release Content
This directory contains drafts of documentation for the current development cycle, which will be published to the website during the next release. You can find more information in the release notes and migration guides files.