pub struct Pak { /* private fields */ }Expand description
Represents a Pak file. This struct provides access to the metadata and data stored within the Pak file.
Implementations§
Source§impl Pak
impl Pak
Sourcepub fn new_from_file<P>(path: P) -> PakResult<Self>
pub fn new_from_file<P>(path: P) -> PakResult<Self>
Loads a Pak from the specified file path. This will not load the entire pak file into memory, just the header.
Sourcepub fn query<T>(
&self,
query: impl PakQueryExpression<T>,
) -> PakResult<T::ReturnType>where
T: DeserializeGroup,
pub fn query<T>(
&self,
query: impl PakQueryExpression<T>,
) -> PakResult<T::ReturnType>where
T: DeserializeGroup,
Loads an object from the pak file via queried indices. This will only load the necessary data into memory.
Sourcepub fn query_pql<T>(&self, pql: &str) -> PakResult<T::ReturnType>where
T: DeserializeGroup + 'static,
pub fn query_pql<T>(&self, pql: &str) -> PakResult<T::ReturnType>where
T: DeserializeGroup + 'static,
Loads an object from the pak file via queried indices. This will only load the necessary data into memory.
Returns the author of the pak file.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the description of the pak file.
Sourcepub fn get_extra<T>(&self) -> PakResult<T>where
T: for<'de> Deserialize<'de>,
pub fn get_extra<T>(&self) -> PakResult<T>where
T: for<'de> Deserialize<'de>,
This returns the extra data that can be saved in the metadata. This can throw an error if the wrong type is asked for.
Sourcepub fn read_err<T>(&self, pointer: &PakPointer) -> PakResult<T>where
T: for<'de> Deserialize<'de>,
pub fn read_err<T>(&self, pointer: &PakPointer) -> PakResult<T>where
T: for<'de> Deserialize<'de>,
Read Data directly with a pointer.
pub fn read<T>(&self, pointer: &PakPointer) -> Option<T>where
T: for<'de> Deserialize<'de>,
pub fn identifier(&self) -> &str
pub fn check_identifier(&self, id: &str) -> PakResult<()>
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> 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