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() -> BundleLoader

Create a new bundle loader

Source

pub fn with_options(options: BundleLoadOptions) -> BundleLoader

Create a new bundle loader with options

Source

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

Load a bundle from file path

Source

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

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, &SerializedFile)>

Find assets by name across all loaded bundles

Source

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

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<(), BinaryError>

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() -> BundleLoader

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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.