Pak

Struct Pak 

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

the pak file with all the goodies

Implementations§

Source§

impl Pak

Source

pub fn new( path: impl AsRef<Path>, version: Version, key_hash: Option<&[u8]>, ) -> Result<Self, Error>

reads a pak file with a known version

Source

pub fn new_any(path: impl AsRef<Path>, key: Option<&[u8]>) -> Result<Pak, Error>

reads a pak file with a guessed version

Source

pub fn version(&self) -> Version

Source

pub fn mount_point(&self) -> &str

Source

pub fn read<W: Write>(&self, entry: &str, writer: &mut W) -> Result<(), Error>

reads the entry into any writer

Source

pub fn read_to_file( &self, entry: &str, path: impl AsRef<Path>, ) -> Result<(), Error>

reads the entry to the given path

Source

pub fn get(&self, entry: &str) -> Result<Vec<u8>, Error>

gets the entry as a vector of bytes

Source

pub fn entries(&self) -> Vec<String>

gets the names of all entries

Trait Implementations§

Source§

impl Debug for Pak

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Pak

§

impl RefUnwindSafe for Pak

§

impl Send for Pak

§

impl Sync for Pak

§

impl Unpin for Pak

§

impl UnwindSafe for Pak

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.