BundleLoadOptions

Struct BundleLoadOptions 

Source
pub struct BundleLoadOptions {
    pub load_assets: bool,
    pub decompress_blocks: bool,
    pub validate: bool,
    pub max_memory: Option<usize>,
    pub max_unityfs_block_cache_memory: Option<usize>,
    pub max_compressed_blocks_info_size: Option<usize>,
    pub max_blocks_info_size: Option<usize>,
    pub max_legacy_directory_compressed_size: Option<usize>,
    pub max_compressed_block_size: Option<usize>,
    pub max_blocks: usize,
    pub max_nodes: usize,
}
Expand description

Bundle loading options

Fields§

§load_assets: bool

Whether to load all assets immediately

§decompress_blocks: bool

Whether to decompress all blocks immediately

§validate: bool

Whether to validate the bundle structure

§max_memory: Option<usize>

Maximum memory usage for decompression (in bytes)

§max_unityfs_block_cache_memory: Option<usize>

Maximum memory for caching UnityFS decompressed blocks during lazy range extraction.

This controls peak memory when AssetBundle::extract_node_data reads only a few nodes from a large UnityFS without fully decompressing the entire bundle.

If None, block cache growth is unbounded (not recommended for untrusted inputs).

§max_compressed_blocks_info_size: Option<usize>

Maximum size of compressed blocks info (metadata) in bytes.

This is a cap on the compressed bytes read from the input stream before decompression.

§max_blocks_info_size: Option<usize>

Maximum size of decompressed blocks info (metadata) in bytes.

§max_legacy_directory_compressed_size: Option<usize>

Maximum size of the legacy (UnityWeb/UnityRaw) directory compressed section in bytes.

This is a cap on the raw bytes read from the input stream before decompression.

§max_compressed_block_size: Option<usize>

Maximum size of a single UnityFS compressed data block (in bytes).

This is a cap on the raw bytes read for each block before decompression. It helps protect against malicious headers that declare multi-GB compressed blocks.

§max_blocks: usize

Maximum number of compression blocks allowed in metadata.

§max_nodes: usize

Maximum number of directory nodes / file entries allowed in metadata.

Implementations§

Source§

impl BundleLoadOptions

Source

pub fn lazy() -> Self

Create options for lazy loading (validate metadata, but do not preload assets or decompress blocks).

Source

pub fn fast() -> Self

Create options for fast loading (minimal processing)

Source

pub fn complete() -> Self

Create options for complete loading (all processing)

Trait Implementations§

Source§

impl Clone for BundleLoadOptions

Source§

fn clone(&self) -> BundleLoadOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BundleLoadOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BundleLoadOptions

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.