Module bundle

Module bundle 

Source
Expand description

Unity AssetBundle processing module

This module provides comprehensive AssetBundle processing capabilities, organized following UnityPy and unity-rs best practices.

§Architecture

The module is organized into several sub-modules:

  • header - Bundle header parsing and validation
  • types - Core data structures (AssetBundle, BundleFileInfo, etc.)
  • compression - Compression handling (LZ4, LZMA, Brotli)
  • parser - Main parsing logic for different bundle formats
  • loader - Resource loading and management

§Examples

use unity_asset_binary::bundle::{BundleLoader, BundleLoadOptions};

// Simple bundle loading
let bundle = unity_asset_binary::bundle::load_bundle("example.bundle")?;
println!("Loaded bundle with {} assets", bundle.asset_count());

// Advanced loading with options
let mut loader = BundleLoader::with_options(BundleLoadOptions::fast());
let bundle = loader.load_from_file("example.bundle")?;

// Find specific assets
let texture_assets = loader.find_assets_by_name("texture");

Re-exports§

pub use compression::BundleCompression;
pub use compression::CompressionOptions;
pub use compression::CompressionStats;
pub use header::BundleFormatInfo;
pub use header::BundleHeader;
pub use loader::BundleLoader;
pub use loader::BundleResourceManager;
pub use loader::LoaderStatistics;
pub use loader::load_bundle;
pub use loader::load_bundle_from_memory;
pub use loader::load_bundle_with_options;
pub use parser::BundleParser;
pub use parser::ParsingComplexity;
pub use types::AssetBundle;
pub use types::BundleFileInfo;
pub use types::BundleLoadOptions;
pub use types::BundleStatistics;
pub use types::DirectoryNode;

Modules§

compression
Bundle compression handling
header
AssetBundle header parsing
loader
Bundle resource loading and management
parser
Bundle parser implementation
types
Bundle data structures

Structs§

BundleInfo
Bundle information summary
BundleProcessor
Main bundle processing facade

Functions§

create_processor
Convenience functions for common operations Create a bundle processor with default settings
extract_file_from_bundle
Quick function to extract a specific file from bundle
get_bundle_info
Quick function to get bundle information
get_supported_formats
Get supported bundle formats
is_valid_bundle
Check if a file is a valid Unity bundle
list_bundle_contents
Quick function to list bundle contents