[][src]Struct rpak::header::PakHeader

pub struct PakHeader {
    pub table_offset: u32,
    pub table_size: u32,
}

The PAK file header

Fields

table_offset: u32

Offset of the file table, from the start of the file

table_size: u32

Size of the file table

Implementations

impl PakHeader[src]

pub fn new(table_offset: u32, table_size: u32) -> Self[src]

Create a new PAK header with the given file table offset and size

pub fn from_bytes(data: &[u8]) -> Result<Self, ()>[src]

Parse a PAK header from a byte slice.

Returns Err(()) if the PAK file header was invalid.

pub fn as_bytes(&self) -> Vec<u8>[src]

Return this PAK header as a byte vector.

Trait Implementations

impl Default for PakHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.