pub struct PakBuilder { /* private fields */ }
Expand description
When it is time to create the pak file, this struct is used to build it. Remember that this struct doen’t have the ability to read data that has been paked or delete data that has been paked.
Implementations§
Source§impl PakBuilder
impl PakBuilder
Sourcepub fn pak_no_search<T: PakItemSerialize>(
&mut self,
item: T,
) -> PakResult<PakPointer>
pub fn pak_no_search<T: PakItemSerialize>( &mut self, item: T, ) -> PakResult<PakPointer>
Adds an item to the pak file that does not support searching. Takes anything that implements PakItemSerialize.
Sourcepub fn pak<T: PakItemSerialize + PakItemSearchable>(
&mut self,
item: T,
) -> PakResult<PakPointer>
pub fn pak<T: PakItemSerialize + PakItemSearchable>( &mut self, item: T, ) -> PakResult<PakPointer>
Adds an item to the pak file that supports searching. Takes anything that implements PakItemSerialize and PakItemSearchable.
Sourcepub fn with_description(self, description: &str) -> Self
pub fn with_description(self, description: &str) -> Self
Adds a description to the pak file’s metadata.
Adds an author to the pak file’s metadata.
Sourcepub fn set_description(&mut self, description: &str)
pub fn set_description(&mut self, description: &str)
Sets the description of the pak file’s metadata.
Sets the author of the pak file’s metadata.
Sourcepub fn build_file(self, path: impl AsRef<Path>) -> PakResult<Pak>
pub fn build_file(self, path: impl AsRef<Path>) -> PakResult<Pak>
Builds the pak file and writes it to the specified path. This also returns a Pak object that is attached to that file.
Sourcepub fn build_in_memory(self) -> PakResult<Pak>
pub fn build_in_memory(self) -> PakResult<Pak>
Builds the pak file and writes it to the specified path. This also returns a Pak object that is attached to that slice of memory.