Struct ModuleHeader

Source
pub struct ModuleHeader {
Show 14 fields magic: u32, pub version: ModuleVersion, pub module_id: i64, pub file_count: u32, loadmanifest_index: i32, runtimeloadmetadata_index: i32, resourcemetadata_index: i32, resource_index: i32, pub(super) strings_size: u32, pub(super) resource_count: u32, pub(super) block_count: u32, build_version: u64, pub(super) hd1_delta: u64, pub(super) data_size: u64,
}
Expand description

Module Header structure containing info on the layout of the module file.

Fields§

§magic: u32

Should be “mohd” (0x64686F6D)

§version: ModuleVersion

Revision number of the module. This determines how offsets are calculated and if tag names should be read.

§module_id: i64

Unique identifier of module.

§file_count: u32

Number of files in the module.

§loadmanifest_index: i32

Index of loadmanifest tag, which contains the tag ids that the module will load.

§runtimeloadmetadata_index: i32

Index of runtimeloadmetadata tag, which contains info on how tags should be loaded at runtime.

§resourcemetadata_index: i32

Index of resourcemetadata tag, which contains info on how resources should be loaded.

§resource_index: i32

Index of the first resource entry (file_count - resource_count).

§strings_size: u32

Total size in bytes of the string table.

§resource_count: u32

Number of resource files.

§block_count: u32

Number of data blocks.

§build_version: u64

Same between modules, changes per build?

§hd1_delta: u64

If non-zero, requires hd1 file.

§data_size: u64

Total size of packed data in the module. Both compressed and uncompressed. Starts after files, blocks, and resources have been read.

This does NOT apply for versions before ModuleVersion::Season3.

Implementations§

Source§

impl ModuleHeader

Source

pub(super) fn read(&mut self, reader: &mut BufReader<File>) -> Result<()>

Reads the module header from the given buffered reader.

§Arguments
  • reader - A mutable reference to a BufReader<File> from which to read the data.
§Errors

Trait Implementations§

Source§

impl Debug for ModuleHeader

Source§

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

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

impl Default for ModuleHeader

Source§

fn default() -> ModuleHeader

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> 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, 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.