Skip to main content

PackHeader

Struct PackHeader 

Source
pub struct PackHeader { /* private fields */ }
Expand description

Header of a Pack, containing all the header-related info of said Pack.

§Header Structure.

BytesTypeData
800-Padded StringU8Fake Preamble/Id of this Pack. Usually “MFH” and a bunch of 00. Only in old Steam Workshop files.
4StringU8Preamble/Id of this Pack. Contains the “version” of this Pack.
4u32Pack Type + Bitwised flags for tweaking certain Pack configurations.
4u32Amount of items in the Pack Index of this Pack.
4u32Lenght in bytes of the Pack Index.
4u32Amount of items in the File Index of this Pack.
4u32Lenght in bytes of the File Index.
8u64Timestamp when this Pack was last edited. Only in PFH2 and PFH3.
20Vec<u8>Extended header data. Only if HAS_EXTENDED_HEADER flag is set.
280SubheaderSubheader data. Only since PFH6.

§Subheader Structure.

Subheader containing extra metadata for the Pack. Only in PFH6.

BytesTypeData
4u32Subheader marker. Marks the begining of the subheader. If missing, there’s no subheader.
4u32Subheader version.
4u32Game version this Pack was done for.
4u32Build number of the game version this Pack was done for.
800-Padded StringU8Tool that made this Pack.
256Vec<u8>Unused bytes.

Implementations§

Source§

impl PackHeader

Source

pub fn pfh_version(&self) -> &PFHVersion

The version of the Pack.

Source

pub fn pfh_file_type(&self) -> &PFHFileType

The type of the Pack.

Source

pub fn bitmask(&self) -> &PFHFlags

The bitmasks applied to the Pack.

Source

pub fn internal_timestamp(&self) -> &u64

The timestamp of the last time the Pack was saved.

Source

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.

Source

pub fn build_number(&self) -> &u32

Build number of the game.

Source

pub fn authoring_tool(&self) -> &String

Tool that created the Pack. Max 8 characters, 00-padded.

Source

pub fn extra_subheader_data(&self) -> &Vec<u8>

Extra subheader data, in case it’s used in the future.

Source§

impl PackHeader

Source

pub fn set_pfh_version(&mut self, val: PFHVersion) -> &mut Self

The version of the Pack.

Source

pub fn set_pfh_file_type(&mut self, val: PFHFileType) -> &mut Self

The type of the Pack.

Source

pub fn set_bitmask(&mut self, val: PFHFlags) -> &mut Self

The bitmasks applied to the Pack.

Source

pub fn set_internal_timestamp(&mut self, val: u64) -> &mut Self

The timestamp of the last time the Pack was saved.

Source

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.

Source

pub fn set_build_number(&mut self, val: u32) -> &mut Self

Build number of the game.

Source

pub fn set_authoring_tool(&mut self, val: String) -> &mut Self

Tool that created the Pack. Max 8 characters, 00-padded.

Source

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

Source§

fn clone(&self) -> PackHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PackHeader

Source§

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

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

impl Default for PackHeader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PackHeader

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PackHeader

Source§

fn eq(&self, other: &PackHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PackHeader

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for PackHeader

Source§

impl StructuralPartialEq for PackHeader

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

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().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,