#How to get a SavedAsset<T> from Handle<T> and Assets<T>
5 messages · Page 1 of 1 (latest)
according to the searchbar, only three functions return SavedAsset and all of them are associated to it
best candidate looks like https://docs.rs/bevy/latest/bevy/asset/saver/struct.SavedAsset.html#method.get_labeled i think
oh nope it's a method, the other two are the only associated functions
i'm a relative novice, but it looks like bevy_asset wants asset saving to fit after a load
might be assetserver's job
Thanks. I found a way to do that.
Firstly, I removed the asset from the Assets<T>, and I got ownership of that asset. Then
fn foo(asset: TableAsset, ...) -> ...{
...
let loaded: LoadedAsset<TableAsset> = asset.into();
let erased = ErasedLoadedAsset::from(loaded);
let saved = SavedAsset::from_loaded(&erased).ok_or(anyhow::anyhow!("Noooooo!!"))?;
...
}