pub struct SqPackResource {
pub game_directory: String,
pub repositories: Vec<Repository>,
/* private fields */
}
Expand description
Used to read files from the retail game, in their SqPack-compressed format.
Fields§
§game_directory: String
The game directory to operate on.
repositories: Vec<Repository>
Repositories in the game directory.
Implementations§
Source§impl SqPackResource
impl SqPackResource
pub fn from_existing(platform: Platform, directory: &str) -> Self
Sourcepub fn find_offset(&mut self, path: &str) -> Option<u64>
pub fn find_offset(&mut self, path: &str) -> Option<u64>
Finds the offset inside of the DAT file for path
.
Sourcepub fn apply_patch(&self, patch_path: &str) -> Result<(), PatchError>
pub fn apply_patch(&self, patch_path: &str) -> Result<(), PatchError>
Applies the patch to game data and returns any errors it encounters. This function will not update the version in the GameData struct.
Sourcepub fn needs_repair(&self) -> Option<Vec<(&Repository, RepairAction)>>
pub fn needs_repair(&self) -> Option<Vec<(&Repository, RepairAction)>>
Detects whether or not the game files need a repair, right now it only checks for invalid version files. If the repair is needed, a list of invalid repositories is given.
Sourcepub fn perform_repair<'a>(
&self,
repositories: &Vec<(&'a Repository, RepairAction)>,
) -> Result<(), RepairError<'a>>
pub fn perform_repair<'a>( &self, repositories: &Vec<(&'a Repository, RepairAction)>, ) -> Result<(), RepairError<'a>>
Performs the repair, assuming any damaging effects it may have Returns true only if all actions were taken are successful. NOTE: This is a destructive operation, especially for InvalidVersion errors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqPackResource
impl RefUnwindSafe for SqPackResource
impl Send for SqPackResource
impl Sync for SqPackResource
impl Unpin for SqPackResource
impl UnwindSafe for SqPackResource
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