Struct rpkg_rs::resource::partition_manager::PartitionManager
source · pub struct PartitionManager {
pub partitions: Vec<ResourcePartition>,
/* private fields */
}Fields§
§partitions: Vec<ResourcePartition>Implementations§
source§impl PartitionManager
impl PartitionManager
sourcepub fn new(
runtime_directory: PathBuf,
package_definition: &PackageDefinitionSource,
) -> Result<Self, PackageManagerError>
pub fn new( runtime_directory: PathBuf, package_definition: &PackageDefinitionSource, ) -> Result<Self, PackageManagerError>
Create a new PartitionManager for the game at the given path, and a custom package definition.
§Arguments
runtime_directory- The path to the game’s runtime directory.package_definition- The package definition to use.
sourcepub fn from_game(
retail_directory: PathBuf,
game_version: WoaVersion,
mount: bool,
) -> Result<Self, PackageManagerError>
pub fn from_game( retail_directory: PathBuf, game_version: WoaVersion, mount: bool, ) -> Result<Self, PackageManagerError>
Create a new PartitionManager by mounting the game at the given path.
§Arguments
retail_path- The path to the game’s retail directory.game_version- The version of the game.mount- Indicates whether to automatically mount the partitions, can eliminate the need to callmount_partitionsseparately
sourcepub fn from_game_with_callback<F>(
retail_directory: PathBuf,
game_version: WoaVersion,
mount: bool,
progress_callback: F,
) -> Result<Self, PackageManagerError>
pub fn from_game_with_callback<F>( retail_directory: PathBuf, game_version: WoaVersion, mount: bool, progress_callback: F, ) -> Result<Self, PackageManagerError>
Create a new PartitionManager by mounting the game at the given path.
§Arguments
retail_path- The path to the game’s retail directory.game_version- The version of the game.mount- Indicates whether to automatically mount the partitions, can eliminate the need to callmount_partitionsseparatelyprogress_callback- A callback function that will be called with the current mounting progress.
sourcepub fn mount_partitions<F>(
&mut self,
progress_callback: F,
) -> Result<(), PackageManagerError>
pub fn mount_partitions<F>( &mut self, progress_callback: F, ) -> Result<(), PackageManagerError>
Mount all the partitions in the game.
§Arguments
progress_callback- A callback function that will be called with the current mounting progress.
sourcepub fn mount_partition<F>(
&mut self,
partition_info: PartitionInfo,
progress_callback: F,
) -> Result<(), PackageManagerError>where
F: FnMut(&PartitionState),
pub fn mount_partition<F>(
&mut self,
partition_info: PartitionInfo,
progress_callback: F,
) -> Result<(), PackageManagerError>where
F: FnMut(&PartitionState),
Mount a single partition in the game.
§Arguments
partition_info- The partition info to mount.progress_callback- A callback function that will be called with the current mounting progress.
pub fn read_resource_from( &self, partition_id: PartitionId, rrid: RuntimeResourceID, ) -> Result<Vec<u8>, PackageManagerError>
pub fn find_partition( &self, partition_id: PartitionId, ) -> Option<&ResourcePartition>
pub fn partitions_with_resource( &self, rrid: &RuntimeResourceID, ) -> Vec<PartitionId>
pub fn resource_infos( &self, rrid: &RuntimeResourceID, ) -> Vec<(PartitionId, &ResourceInfo)>
pub fn resource_info_from( &self, partition_id: &PartitionId, rrid: &RuntimeResourceID, ) -> Result<&ResourceInfo, PackageManagerError>
pub fn print_resource_changelog(&self, rrid: &RuntimeResourceID)
Auto Trait Implementations§
impl Freeze for PartitionManager
impl RefUnwindSafe for PartitionManager
impl Send for PartitionManager
impl Sync for PartitionManager
impl Unpin for PartitionManager
impl UnwindSafe for PartitionManager
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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