Struct VPKRespawn

Source
pub struct VPKRespawn {
    pub header: VPKHeaderRespawn,
    pub tree: VPKTree<VPKDirectoryEntryRespawn>,
    pub archive_cams: HashMap<u16, VPKRespawnCam>,
}
Available on crate feature revpk only.
Expand description

The Respawn VPK format.

Fields§

§header: VPKHeaderRespawn

The VPK’s header.

§tree: VPKTree<VPKDirectoryEntryRespawn>

The tree of files in the VPK.

§archive_cams: HashMap<u16, VPKRespawnCam>

The parsed CAM files for this VPK (external files, not included int dir.vpk file)

Implementations§

Source§

impl VPKRespawn

Source

pub fn read_cam( &mut self, archive_index: u16, cam_path: &String, ) -> Result<(), String>

Reads a CAM file and adds it to the map of parsed CAMs for this VPK

Source

pub fn read_all_cams( &mut self, archive_path: &String, vpk_name: &String, ) -> Result<(), String>

Reads all CAM files for this VPK and adds them to the map of parsed CAMs for this VPK

Trait Implementations§

Source§

impl PakReader for VPKRespawn

Source§

fn new() -> Self

Create an empty readable VPK which can then be constructed programmatically.
Source§

fn from_file(file: &mut File) -> Result<Self, String>

Create a readable VPK from a directory file.
Source§

fn read_file( &self, archive_path: &String, vpk_name: &String, file_path: &String, ) -> Option<Vec<u8>>

Read the contents of a file stored in the VPK into memory.
Source§

fn extract_file( &self, archive_path: &String, vpk_name: &String, file_path: &String, output_path: &String, ) -> Result<(), String>

Extract the contents of a file stored in the VPK to a file system location.
Source§

fn extract_file_mem_map( &self, archive_path: &String, archive_mmaps: &HashMap<u16, FileBuffer>, vpk_name: &String, file_path: &String, output_path: &String, ) -> Result<(), String>

Available on crate feature mem-map only.
Extract the contents of a file stored in the VPK to a file system location using memory-mapped files. Memory mapped files for every archive used in the extraction must be provided.
Source§

impl PakWriter for VPKRespawn

Source§

fn write_dir(&self, output_path: &String) -> Result<(), String>

Write the dir.vpk file for this VPK to disk with a given path. Does not modify or create archives if the any VPKDirectoryEntry has changed.
Source§

impl PartialEq for VPKRespawn

Source§

fn eq(&self, other: &VPKRespawn) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&mut File> for VPKRespawn

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_from(file: &mut File) -> Result<Self, String>

Performs the conversion.
Source§

impl Eq for VPKRespawn

Source§

impl StructuralPartialEq for VPKRespawn

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, 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.