pub struct BundleLoader { /* private fields */ }Expand description
Bundle resource loader
This struct provides high-level functionality for loading and managing AssetBundle resources, including caching and async loading support.
Implementations§
Source§impl BundleLoader
impl BundleLoader
Sourcepub fn with_options(options: BundleLoadOptions) -> Self
pub fn with_options(options: BundleLoadOptions) -> Self
Create a new bundle loader with options
Sourcepub fn load_from_file<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<&AssetBundle>
pub fn load_from_file<P: AsRef<Path>>( &mut self, path: P, ) -> Result<&AssetBundle>
Load a bundle from file path
Sourcepub fn load_from_memory(
&mut self,
name: String,
data: Vec<u8>,
) -> Result<&AssetBundle>
pub fn load_from_memory( &mut self, name: String, data: Vec<u8>, ) -> Result<&AssetBundle>
Load a bundle from memory
Sourcepub fn get_bundle(&self, name: &str) -> Option<&AssetBundle>
pub fn get_bundle(&self, name: &str) -> Option<&AssetBundle>
Get a loaded bundle by name
Sourcepub fn get_bundle_mut(&mut self, name: &str) -> Option<&mut AssetBundle>
pub fn get_bundle_mut(&mut self, name: &str) -> Option<&mut AssetBundle>
Get a mutable reference to a loaded bundle
Sourcepub fn unload_bundle(&mut self, name: &str) -> bool
pub fn unload_bundle(&mut self, name: &str) -> bool
Unload a bundle
Sourcepub fn unload_all(&mut self)
pub fn unload_all(&mut self)
Unload all bundles
Sourcepub fn loaded_bundles(&self) -> Vec<&str>
pub fn loaded_bundles(&self) -> Vec<&str>
Get list of loaded bundle names
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get total memory usage of loaded bundles
Sourcepub fn find_assets_by_name(&self, name: &str) -> Vec<(&str, &Asset)>
pub fn find_assets_by_name(&self, name: &str) -> Vec<(&str, &Asset)>
Find assets by name across all loaded bundles
Sourcepub fn find_assets_by_type(&self, _type_id: i32) -> Vec<(&str, &Asset)>
pub fn find_assets_by_type(&self, _type_id: i32) -> Vec<(&str, &Asset)>
Find assets by type ID across all loaded bundles
Sourcepub fn get_statistics(&self) -> LoaderStatistics
pub fn get_statistics(&self) -> LoaderStatistics
Get bundle statistics
Sourcepub fn validate_all(&self) -> Result<()>
pub fn validate_all(&self) -> Result<()>
Validate all loaded bundles
Sourcepub fn set_options(&mut self, options: BundleLoadOptions)
pub fn set_options(&mut self, options: BundleLoadOptions)
Set loading options
Sourcepub fn options(&self) -> &BundleLoadOptions
pub fn options(&self) -> &BundleLoadOptions
Get current loading options
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BundleLoader
impl !RefUnwindSafe for BundleLoader
impl Send for BundleLoader
impl Sync for BundleLoader
impl Unpin for BundleLoader
impl !UnwindSafe for BundleLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more