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<SerializedFileHeader, BinaryError>
pub fn from_reader( reader: &mut BinaryReader<'_>, ) -> Result<SerializedFileHeader, BinaryError>
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 validate(&self) -> Result<(), BinaryError>
pub fn validate(&self) -> Result<(), BinaryError>
Validate header consistency
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§fn default() -> SerializedFileHeader
fn default() -> SerializedFileHeader
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SerializedFileHeader
impl<'de> Deserialize<'de> for SerializedFileHeader
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerializedFileHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerializedFileHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SerializedFileHeader
impl Serialize for SerializedFileHeader
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,
Serialize this value into the given Serde serializer. 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().