pub struct BundleHeader {
pub signature: String,
pub version: u32,
pub unity_version: String,
pub unity_revision: String,
pub size: u64,
pub compressed_blocks_info_size: u32,
pub uncompressed_blocks_info_size: u32,
pub flags: u32,
pub actual_header_size: u64,
}Expand description
AssetBundle header information
Contains metadata about the bundle including version, compression settings, and structural information needed for parsing the bundle contents.
Fields§
§signature: StringBundle signature (e.g., “UnityFS”, “UnityWeb”, “UnityRaw”)
version: u32Bundle format version
unity_version: StringUnity version that created this bundle
unity_revision: StringUnity revision
size: u64Total bundle size
compressed_blocks_info_size: u32Compressed blocks info size
uncompressed_blocks_info_size: u32Uncompressed blocks info size
flags: u32Archive flags (compression type, block info location, etc.)
actual_header_size: u64Actual header size (recorded during parsing)
Implementations§
Source§impl BundleHeader
impl BundleHeader
Sourcepub fn from_reader(
reader: &mut BinaryReader<'_>,
) -> Result<BundleHeader, BinaryError>
pub fn from_reader( reader: &mut BinaryReader<'_>, ) -> Result<BundleHeader, BinaryError>
Parse bundle header from binary data
This method reads the bundle header from a binary reader, handling different bundle formats (UnityFS, UnityWeb, etc.).
Sourcepub fn compression_type(&self) -> Result<CompressionType, BinaryError>
pub fn compression_type(&self) -> Result<CompressionType, BinaryError>
Get the compression type from flags
Sourcepub fn block_info_at_end(&self) -> bool
pub fn block_info_at_end(&self) -> bool
Check if block info is at the end of the file
Sourcepub fn is_unity_fs(&self) -> bool
pub fn is_unity_fs(&self) -> bool
Check if this is a UnityFS format bundle
Sourcepub fn data_offset(&self) -> u64
pub fn data_offset(&self) -> u64
Get the expected data offset after the header
Sourcepub fn header_size(&self) -> u64
pub fn header_size(&self) -> u64
Calculate the size of the header itself
Sourcepub fn validate(&self) -> Result<(), BinaryError>
pub fn validate(&self) -> Result<(), BinaryError>
Validate the header for consistency
Sourcepub fn format_info(&self) -> BundleFormatInfo
pub fn format_info(&self) -> BundleFormatInfo
Get bundle format information
Trait Implementations§
Source§impl Clone for BundleHeader
impl Clone for BundleHeader
Source§fn clone(&self) -> BundleHeader
fn clone(&self) -> BundleHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BundleHeader
impl Debug for BundleHeader
Source§impl Default for BundleHeader
impl Default for BundleHeader
Source§fn default() -> BundleHeader
fn default() -> BundleHeader
Source§impl<'de> Deserialize<'de> for BundleHeader
impl<'de> Deserialize<'de> for BundleHeader
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BundleHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BundleHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for BundleHeader
impl Serialize for BundleHeader
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for BundleHeader
impl RefUnwindSafe for BundleHeader
impl Send for BundleHeader
impl Sync for BundleHeader
impl Unpin for BundleHeader
impl UnsafeUnpin for BundleHeader
impl UnwindSafe for BundleHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().