-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
AssetServer::is_loaded_with_dependencies
should return a LoadState
.
#15098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The main challenge here will be determining what to do with failed states: different dependencies could fail for different reasons. I think that returning the first observed failure is probably a good, easy-to-implement and easy-to-use solution. |
@alice-i-cecile Propose also renaming method to |
Sure :) Make sure you make is_loaded consistent. |
So, currently |
Yes please. It might make sense to return a Vec of such errors instead of just the first, but I'll defer to your judgement there during implementation. |
Sounds good. 3 more questions lol.
Is this something we want to keep? It isn't super clear why you would want one or the other. Sorry for all the questions! |
This is more complex than I anticipated! Thanks for diving in, and feel free to drop it if you feel you're in over your head.
|
Thank you, sounds good regarding 2 and 3. I’ll leave the semantics as is for 1 and look into them later if needed. Thinking forward, I’m not sure I understand the value of the non-recursive DependencyLoadState and I also saw there are multiple types of dependencies (normal and loader) which are not distinguishable by LoadState. Both could be worth looking into if there is a semantic change in the future. Any idea if these same asset dependencies are intended to be used as part of the bsn hierarchy? |
Seconding this! I have a decent understanding of the high level of bevy_asset, but a lot of these details feel quite mysterious to me still, and the docs don't do enough to demystify it.
My understanding is that asset dependencies are orthogonal to the bsn hierarchy: they're used to be able to generate the required asset, but once that's in place they won't be nested in the entity hierarchy in any way. @cart may have more solid answers to all of these questions though. |
- implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - adds error to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed
- implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - adds error to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed
- implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - adds error to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed
- implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - adds error to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed
- implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - adds error to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed
- implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - adds error to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed - fixes bug where successful dependency load overwrites previous dependency failed load state
# Objective - implements consistently named AssertServer methods for asset, dependency, and recursive dependency load states - returns relevant LoadState when required, including error information for failed loads - resolves #15098 ## Solution - implement consistently named LoadState accessor methods: - load_state, dependency_load_state, recursive_dependency_load_state (return unwrapped load states) - get_load_state, get_dependency_load_state, get_recursive_dependency_load_state (return Option) - is_loaded, is_loaded_with_dependencies, is_loaded_with_recursive_dependencies (return bool) - adds AssetLoadError to DependencyLoadState::Failed and RecursiveDependencyLoadState::Failed ## Testing - Added coverage to existing unit tests
AssetServer::is_loaded_with_dependencies
returns abool
not aLoadState
.Originally posted by @bushrat011899 in #15056 (comment)
This is much less helpful than returning failure information! When this is updated, make sure to update the linked documentation in the module docs.
The text was updated successfully, but these errors were encountered: