pub struct PackHeader { /* private fields */ }Expand description
Header of a Pack, containing all the header-related info of said Pack.
§Header Structure.
| Bytes | Type | Data |
|---|---|---|
| 8 | 00-Padded StringU8 | Fake Preamble/Id of this Pack. Usually “MFH” and a bunch of 00. Only in old Steam Workshop files. |
| 4 | StringU8 | Preamble/Id of this Pack. Contains the “version” of this Pack. |
| 4 | u32 | Pack Type + Bitwised flags for tweaking certain Pack configurations. |
| 4 | u32 | Amount of items in the Pack Index of this Pack. |
| 4 | u32 | Lenght in bytes of the Pack Index. |
| 4 | u32 | Amount of items in the File Index of this Pack. |
| 4 | u32 | Lenght in bytes of the File Index. |
| 8 | u64 | Timestamp when this Pack was last edited. Only in PFH2 and PFH3. |
| 20 | Vec<u8> | Extended header data. Only if HAS_EXTENDED_HEADER flag is set. |
| 280 | Subheader | Subheader data. Only since PFH6. |
§Subheader Structure.
Subheader containing extra metadata for the Pack. Only in PFH6.
| Bytes | Type | Data |
|---|---|---|
| 4 | u32 | Subheader marker. Marks the begining of the subheader. If missing, there’s no subheader. |
| 4 | u32 | Subheader version. |
| 4 | u32 | Game version this Pack was done for. |
| 4 | u32 | Build number of the game version this Pack was done for. |
| 8 | 00-Padded StringU8 | Tool that made this Pack. |
| 256 | Vec<u8> | Unused bytes. |
Implementations§
Source§impl PackHeader
impl PackHeader
Sourcepub fn pfh_version(&self) -> &PFHVersion
pub fn pfh_version(&self) -> &PFHVersion
The version of the Pack.
Sourcepub fn pfh_file_type(&self) -> &PFHFileType
pub fn pfh_file_type(&self) -> &PFHFileType
The type of the Pack.
Sourcepub fn internal_timestamp(&self) -> &u64
pub fn internal_timestamp(&self) -> &u64
The timestamp of the last time the Pack was saved.
Sourcepub fn game_version(&self) -> &u32
pub fn game_version(&self) -> &u32
Game version this Pack is intended for. This usually triggers the “outdated mod” warning in the launcher if it doesn’t match the current exe version.
Sourcepub fn build_number(&self) -> &u32
pub fn build_number(&self) -> &u32
Build number of the game.
Tool that created the Pack. Max 8 characters, 00-padded.
Sourcepub fn extra_subheader_data(&self) -> &Vec<u8> ⓘ
pub fn extra_subheader_data(&self) -> &Vec<u8> ⓘ
Extra subheader data, in case it’s used in the future.
Source§impl PackHeader
impl PackHeader
Sourcepub fn set_pfh_version(&mut self, val: PFHVersion) -> &mut Self
pub fn set_pfh_version(&mut self, val: PFHVersion) -> &mut Self
The version of the Pack.
Sourcepub fn set_pfh_file_type(&mut self, val: PFHFileType) -> &mut Self
pub fn set_pfh_file_type(&mut self, val: PFHFileType) -> &mut Self
The type of the Pack.
Sourcepub fn set_bitmask(&mut self, val: PFHFlags) -> &mut Self
pub fn set_bitmask(&mut self, val: PFHFlags) -> &mut Self
The bitmasks applied to the Pack.
Sourcepub fn set_internal_timestamp(&mut self, val: u64) -> &mut Self
pub fn set_internal_timestamp(&mut self, val: u64) -> &mut Self
The timestamp of the last time the Pack was saved.
Sourcepub fn set_game_version(&mut self, val: u32) -> &mut Self
pub fn set_game_version(&mut self, val: u32) -> &mut Self
Game version this Pack is intended for. This usually triggers the “outdated mod” warning in the launcher if it doesn’t match the current exe version.
Sourcepub fn set_build_number(&mut self, val: u32) -> &mut Self
pub fn set_build_number(&mut self, val: u32) -> &mut Self
Build number of the game.
Tool that created the Pack. Max 8 characters, 00-padded.
Sourcepub fn set_extra_subheader_data(&mut self, val: Vec<u8>) -> &mut Self
pub fn set_extra_subheader_data(&mut self, val: Vec<u8>) -> &mut Self
Extra subheader data, in case it’s used in the future.
Trait Implementations§
Source§impl Clone for PackHeader
impl Clone for PackHeader
Source§fn clone(&self) -> PackHeader
fn clone(&self) -> PackHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackHeader
impl Debug for PackHeader
Source§impl Default for PackHeader
impl Default for PackHeader
Source§impl<'de> Deserialize<'de> for PackHeader
impl<'de> Deserialize<'de> for PackHeader
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>,
Source§impl PartialEq for PackHeader
impl PartialEq for PackHeader
Source§impl Serialize for PackHeader
impl Serialize for PackHeader
impl Eq for PackHeader
impl StructuralPartialEq for PackHeader
Auto Trait Implementations§
impl Freeze for PackHeader
impl RefUnwindSafe for PackHeader
impl Send for PackHeader
impl Sync for PackHeader
impl Unpin for PackHeader
impl UnsafeUnpin for PackHeader
impl UnwindSafe for PackHeader
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,
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 more§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().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.