Skip to main content

PkgHeader

Struct PkgHeader 

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

Parsed PKG header information.

Implementations§

Source§

impl PkgHeader

Source

pub fn read(pkg: &[u8]) -> Result<Self, ReadError>

Parses a PKG header from raw bytes.

§Errors

Returns an error if the data is too small or has an invalid magic number.

Source

pub const fn entry_count(&self) -> usize

Returns the number of entries in the PKG.

Source

pub const fn table_offset(&self) -> usize

Returns the offset to the entry table.

Source

pub const fn pfs_offset(&self) -> usize

Returns the offset to the PFS image.

Source

pub const fn pfs_size(&self) -> usize

Returns the size of the PFS image.

Source

pub fn content_id(&self) -> &ContentId

Returns the content ID.

Source

pub const fn pkg_type(&self) -> u32

Returns the PKG type.

Source

pub const fn drm_type(&self) -> u32

Returns the DRM type.

Source

pub const fn drm_type_name(&self) -> &'static str

Returns the human-readable name for the DRM type.

Source

pub const fn content_type(&self) -> u32

Returns the content type.

Source

pub const fn content_type_name(&self) -> &'static str

Returns the human-readable name for the content type.

Source

pub const fn content_flags(&self) -> ContentFlags

Returns the content flags.

Source

pub const fn pkg_size(&self) -> u64

Returns the total PKG file size.

Source

pub const fn file_count(&self) -> u32

Returns the file count.

Source

pub const fn raw_header(&self) -> &PkgHeaderRaw

Returns the raw header.

Trait Implementations§

Source§

impl Debug for PkgHeader

Source§

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

Formats the value using the given formatter. 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> Same for T

Source§

type Output = T

Should always be Self
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