pub struct PkgHeader { /* private fields */ }Expand description
Parsed PKG header information.
Implementations§
Source§impl PkgHeader
impl PkgHeader
Sourcepub fn read(pkg: &[u8]) -> Result<Self, ReadError>
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.
Sourcepub const fn entry_count(&self) -> usize
pub const fn entry_count(&self) -> usize
Returns the number of entries in the PKG.
Sourcepub const fn table_offset(&self) -> usize
pub const fn table_offset(&self) -> usize
Returns the offset to the entry table.
Sourcepub const fn pfs_offset(&self) -> usize
pub const fn pfs_offset(&self) -> usize
Returns the offset to the PFS image.
Sourcepub fn content_id(&self) -> &ContentId
pub fn content_id(&self) -> &ContentId
Returns the content ID.
Sourcepub const fn drm_type_name(&self) -> &'static str
pub const fn drm_type_name(&self) -> &'static str
Returns the human-readable name for the DRM type.
Sourcepub const fn content_type(&self) -> u32
pub const fn content_type(&self) -> u32
Returns the content type.
Sourcepub const fn content_type_name(&self) -> &'static str
pub const fn content_type_name(&self) -> &'static str
Returns the human-readable name for the content type.
Sourcepub const fn content_flags(&self) -> ContentFlags
pub const fn content_flags(&self) -> ContentFlags
Returns the content flags.
Sourcepub const fn file_count(&self) -> u32
pub const fn file_count(&self) -> u32
Returns the file count.
Sourcepub const fn raw_header(&self) -> &PkgHeaderRaw
pub const fn raw_header(&self) -> &PkgHeaderRaw
Returns the raw header.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PkgHeader
impl RefUnwindSafe for PkgHeader
impl Send for PkgHeader
impl Sync for PkgHeader
impl Unpin for PkgHeader
impl UnwindSafe for PkgHeader
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
Mutably borrows from an owned value. Read more