BundleLoader

Struct BundleLoader 

Source
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

Source

pub fn new() -> Self

Create a new bundle loader

Source

pub fn with_options(options: BundleLoadOptions) -> Self

Create a new bundle loader with options

Source

pub fn load_from_file<P: AsRef<Path>>( &mut self, path: P, ) -> Result<&AssetBundle>

Load a bundle from file path

Source

pub fn load_from_memory( &mut self, name: String, data: Vec<u8>, ) -> Result<&AssetBundle>

Load a bundle from memory

Source

pub fn get_bundle(&self, name: &str) -> Option<&AssetBundle>

Get a loaded bundle by name

Source

pub fn get_bundle_mut(&mut self, name: &str) -> Option<&mut AssetBundle>

Get a mutable reference to a loaded bundle

Source

pub fn unload_bundle(&mut self, name: &str) -> bool

Unload a bundle

Source

pub fn unload_all(&mut self)

Unload all bundles

Source

pub fn loaded_bundles(&self) -> Vec<&str>

Get list of loaded bundle names

Source

pub fn memory_usage(&self) -> usize

Get total memory usage of loaded bundles

Source

pub fn find_assets_by_name(&self, name: &str) -> Vec<(&str, &Asset)>

Find assets by name across all loaded bundles

Source

pub fn find_assets_by_type(&self, _type_id: i32) -> Vec<(&str, &Asset)>

Find assets by type ID across all loaded bundles

Source

pub fn get_statistics(&self) -> LoaderStatistics

Get bundle statistics

Source

pub fn validate_all(&self) -> Result<()>

Validate all loaded bundles

Source

pub fn set_options(&mut self, options: BundleLoadOptions)

Set loading options

Source

pub fn options(&self) -> &BundleLoadOptions

Get current loading options

Trait Implementations§

Source§

impl Default for BundleLoader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.