Skip to main content

PackFile

Trait PackFile 

Source
pub trait PackFile {
    // Required methods
    fn open<P: AsRef<Path>>(path: P) -> Option<Self>
       where Self: Sized;
    fn has_entry(&self, path: &str) -> bool;
    fn read_entry(&self, path: &str) -> Option<Vec<u8>>;
}
Expand description

Represents a loaded VPK or generic pack file archive.

Required Methods§

Source

fn open<P: AsRef<Path>>(path: P) -> Option<Self>
where Self: Sized,

Opens a pack file from the given physical path.

Source

fn has_entry(&self, path: &str) -> bool

Checks if a given file entry exists within the pack file.

Source

fn read_entry(&self, path: &str) -> Option<Vec<u8>>

Reads the specified entry’s binary data from the pack file.

Implementors§