pub struct SerializedFileHeader {
pub metadata_size: u32,
pub file_size: u64,
pub version: u32,
pub data_offset: u64,
pub endian: u8,
pub reserved: [u8; 3],
}Expand description
Header of a Unity SerializedFile
Contains metadata about the serialized file including version information, data layout, and endianness settings.
Fields§
§metadata_size: u32Size of the metadata section
file_size: u64Total file size
version: u32File format version
data_offset: u64Offset to the data section
endian: u8Endianness (0 = little, 1 = big)
reserved: [u8; 3]Reserved bytes
Implementations§
Source§impl SerializedFileHeader
impl SerializedFileHeader
Sourcepub fn from_reader(reader: &mut BinaryReader<'_>) -> Result<Self>
pub fn from_reader(reader: &mut BinaryReader<'_>) -> Result<Self>
Parse header from binary data (improved based on unity-rs)
Sourcepub fn byte_order(&self) -> ByteOrder
pub fn byte_order(&self) -> ByteOrder
Get the byte order from the endian flag
Sourcepub fn format_info(&self) -> HeaderFormatInfo
pub fn format_info(&self) -> HeaderFormatInfo
Get header format information
Sourcepub fn header_size(&self) -> u32
pub fn header_size(&self) -> u32
Get the size of the header itself
Sourcepub fn supports_type_trees(&self) -> bool
pub fn supports_type_trees(&self) -> bool
Check if this version supports TypeTrees
Sourcepub fn supports_script_types(&self) -> bool
pub fn supports_script_types(&self) -> bool
Check if this version supports script types
Sourcepub fn uses_new_object_format(&self) -> bool
pub fn uses_new_object_format(&self) -> bool
Check if this version uses the new object format
Trait Implementations§
Source§impl Clone for SerializedFileHeader
impl Clone for SerializedFileHeader
Source§fn clone(&self) -> SerializedFileHeader
fn clone(&self) -> SerializedFileHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SerializedFileHeader
impl Debug for SerializedFileHeader
Source§impl Default for SerializedFileHeader
impl Default for SerializedFileHeader
Source§impl<'de> Deserialize<'de> for SerializedFileHeader
impl<'de> Deserialize<'de> for SerializedFileHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SerializedFileHeader
impl RefUnwindSafe for SerializedFileHeader
impl Send for SerializedFileHeader
impl Sync for SerializedFileHeader
impl Unpin for SerializedFileHeader
impl UnwindSafe for SerializedFileHeader
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
Mutably borrows from an owned value. Read more