MPQUserData

Struct MPQUserData 

Source
pub struct MPQUserData {
    pub user_data_size: u32,
    pub archive_header_offset: u32,
    pub user_data_header_size: u32,
    pub content: Vec<u8>,
}
Expand description

The MPQ User Data

Fields§

§user_data_size: u32

The number of bytes that have been allocated for user data.

§archive_header_offset: u32

The offset in the file to continue reading the archive header.

§user_data_header_size: u32

The block to store user data in.

§content: Vec<u8>

The contents of the user data, in Starcraft 2 replay files contains the build information of the game version that created the replay.

Implementations§

Source§

impl MPQUserData

Source

pub fn parse(input: &[u8]) -> IResult<&[u8], Self>

Parses all the fields in the expected order

Source

pub fn parse_user_data_size(input: &[u8]) -> IResult<&[u8], u32>

Offset 0x04: int32 UserDataSize

The number of bytes that have been allocated in this archive for user data. This does not need to be the exact size of the data itself, but merely the maximum amount of data which may be stored in this archive.

Source

pub fn parse_archive_header_offset(input: &[u8]) -> IResult<&[u8], u32>

Offset 0x08: int32 ArchiveHeaderOffset

The offset in the file at which to continue the search for the archive header.

Source

pub fn parse_user_data_header_size(input: &[u8]) -> IResult<&[u8], u32>

Offset 0x0c: int32 UserDataHeaderSize The block to store user data in.

Source

pub fn parse_content( input: &[u8], user_data_header_size: u32, ) -> IResult<&[u8], Vec<u8>>

Offset 0x10: byte(UserDataSize) UserData

The block to store user data in.

Source

pub fn consume_until_header_offset( input: &[u8], user_data_header_size: u32, archive_header_offset: u32, ) -> IResult<&[u8], ()>

Offset Varies: padded data

Consumes until the header_offset, in MPyQ this is done through file.seek

Trait Implementations§

Source§

impl Debug for MPQUserData

Source§

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

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

impl Default for MPQUserData

Source§

fn default() -> MPQUserData

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more