Skip to main content

QuakePack

Struct QuakePack 

Source
pub struct QuakePack {
    pub lumps: Vec<QuakePackLump>,
}
Expand description

A quake .PAK file. Contains game data for Quake as well as games in the GoldSrc family of engines (todo can someone verify? -nf)

Fields§

§lumps: Vec<QuakePackLump>

The series of lumps (named blocks of binary data) contained in the file.

Implementations§

Source§

impl QuakePack

Source

pub fn blank() -> Self

Create a new, empty Quake/GoldSrc pack file.

Source

pub fn load(f: &mut File) -> Result<Self>

Load a Quake pack from a file.

Source

pub fn save(&self, f: &mut File) -> Result<()>

Write the Quake/Goldsrc pack to a file on disk.

Trait Implementations§

Source§

impl Clone for QuakePack

Source§

fn clone(&self) -> QuakePack

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QuakePack

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FlatClod<QuakePackLump> for QuakePack

Source§

fn clump_amt(&self) -> usize

Get the amount of clumps.
Source§

fn nth_clump(&self, n: usize) -> &QuakePackLump

Borrows a single clump by number.
Source§

fn a_sub_nth_clumps( &self, a: impl Iterator<Item = usize>, ) -> Vec<&QuakePackLump>

Borrows many clumps by numbers. The range may be non-contiguous. The returned clumps are always in numerically increasing order, and are not duplicated, regardless of the ordering or overlapping of the provided range(s).
Source§

fn all_clumps(&self) -> Vec<&Q>

Borrows every clump.
Source§

fn which_clumps(&self, s: impl AsRef<str>) -> Vec<usize>

Indices of clumps with the specified name.
Source§

fn clumps_with_name(&self, s: impl AsRef<str>) -> Vec<&Q>

Get every clump with the specified name. The clumps will be in numerically increasing order by their index in the wad.
Source§

fn clump_by_name(&self, s: impl AsRef<str>) -> Option<&Q>

Get a clump by it’s specific name. If multiple clumps with the name exist, returns the first one. If no clumps with the name exist, returns None.
Source§

fn indices_between_markers( &self, start: impl AsRef<str>, end: impl AsRef<str>, ) -> Vec<usize>

Returns the indices of clumps between the given markers, sorted numerically.
Source§

fn clumps_between_markers( &self, start: impl AsRef<str>, end: impl AsRef<str>, ) -> Vec<&Q>

Borrows all clumps between the given markers, sorted numerically by index.
Source§

impl FlatClodMut<QuakePackLump> for QuakePack

Source§

fn nth_clump_mut(&mut self, n: usize) -> &mut QuakePackLump

Mutably borrows a single clump by number.
Source§

fn a_sub_nth_clumps_mut( &mut self, a: impl Iterator<Item = usize>, ) -> Vec<&mut QuakePackLump>

Mutably borrows many clumps by numbers. The range may be non-contiguous. The returned clumps are always in numerically increasing order, and are not duplicated, regardless of the ordering or overlapping of the provided range(s).
Source§

fn insert_clump(&mut self, l: QuakePackLump, n: usize)

Insert a clump into the clod at the specified position.
Source§

fn remove_clump(&mut self, n: usize) -> QuakePackLump

Source§

fn all_clumps_mut(&mut self) -> Vec<&mut Q>

Borrows every clump.
Source§

fn clumps_with_name_mut(&mut self, s: impl AsRef<str>) -> Vec<&mut Q>

Mutably borrow every clump with the specified name. The clumps will be in numerically increasing order by their index in the clod.
Source§

fn clump_by_name_mut(&mut self, s: impl AsRef<str>) -> Option<&mut Q>

Mutably borrow a clump by it’s specific name. If multiple clumps with the name exist, returns the first one. If no clumps with the name exist, returns None.
Source§

fn clumps_between_markers_mut( &mut self, start: impl AsRef<str>, end: impl AsRef<str>, ) -> Vec<&mut Q>

Mutably borrows all clumps between the given markers, sorted numerically by index.
Source§

fn append_clump(&mut self, l: Q)

Add a clump to the clod at the end.
Source§

fn inject_clumps(&mut self, ls: impl Iterator<Item = Q>, n: usize)

Insert a series of clumps at the specified position.
Source§

fn extract_clumps(&mut self, a: impl Iterator<Item = usize>) -> Vec<Q>

Remove a set of clumps specified by the range provided.

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<C, M> Clod<C, PhantomDirectory> for M
where C: Clump, M: FlatClod<C>,

Source§

fn ent_amt(&self) -> usize

Get the amount of entities.
Source§

fn nth_ent(&self, n: usize) -> &C

Borrow a single entity by number.
Source§

fn a_sub_nth_ents(&self, a: impl Iterator<Item = usize>) -> Vec<&C>

in numerically increasing order, and are not duplicated, regardless of the ordering or overlapping of the provided range(s).
Source§

impl<C, M> ClodMut<C, PhantomDirectory> for M
where C: ClumpMut, M: FlatClodMut<C>,

Source§

fn nth_ent_mut(&mut self, n: usize) -> &mut C

Mutably borrow a single entity by number.
Source§

fn a_sub_nth_ents_mut(&mut self, a: impl Iterator<Item = usize>) -> Vec<&mut C>

in numerically increasing order, and are not duplicated, regardless of the ordering or overlapping of the provided range(s).
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.