pub struct Pack { /* private fields */ }Expand description
Packs are a container-type file, used for “packing” all game assets into single files, to speed up disk reads.
Their format has passed through multiple iterations since empire, getting changes on almost all iterations, like timestamps, encryption, compression,…
§Pack Structure
| Bytes | Type | Data |
|---|---|---|
| 20-384 | PackHeader | Header of the Pack. Lenght depends on Pack version and flags enabled. |
| * | Pack Index | Index containing the list of Packs this Pack depends on. |
| * | File Index | Index containing the list of Files this Pack depends on |
| * | File Data | Data of the files contained in this Pack. |
| 256 | Appendix | Unknown data at the end of the Pack. Only seen in Arena’s encrypted Packs. |
§Pack Index
The Pack Index contains a list of Packs that will be force-loaded before this mod.
| Bytes | Type | Data |
|---|---|---|
| * | Null-terminated StringU8 | Pack file name. |
§File Index
The File Index contains the metadata of the Files this Pack contains, in the same order their data is, further in the Pack.
| Bytes | Type | Data |
|---|---|---|
| 4 | u32 | Size of the file’s data, in bytes. |
| 8 | u64 | Timestamp of the file, if the header has the HAS_INDEX_WITH_TIMESTAMPS flag enabled. Only in PFH2 and PFH3. |
| 4 | u32 | Truncated timestamp of the file, if the header has the HAS_INDEX_WITH_TIMESTAMPS flag enabled. Only since PFH4. |
| 1 | bool | If the file is compressed. Only since PFH5. |
| * | Null-terminated StringU8 | File’s path within the Pack. |
§File Data
The raw data of the files contained by this Pack, in the same order as their indexes. Not much to explain here.
Implementations§
Source§impl Pack
impl Pack
Sourcepub fn disk_file_path(&self) -> &String
pub fn disk_file_path(&self) -> &String
The path of the Pack on disk, if exists. If not, then this should be empty.
Sourcepub fn disk_file_offset(&self) -> &u64
pub fn disk_file_offset(&self) -> &u64
The offset on the disk file the data of this Pack starts. Usually 0.
Sourcepub fn local_timestamp(&self) -> &u64
pub fn local_timestamp(&self) -> &u64
Timestamp from the moment this Pack was open. To check if the file was edited on disk while we had it open.
Sourcepub fn header(&self) -> &PackHeader
pub fn header(&self) -> &PackHeader
Header data of this Pack.
Sourcepub fn dependencies(&self) -> &Vec<(bool, String)>
pub fn dependencies(&self) -> &Vec<(bool, String)>
List of Packs this Pack depends on. If the boolean is true, the packs are also required to be loaded before himself when starting the game.
In other places, we may refer to this as the Dependency List.
Sourcepub fn paths(&self) -> &HashMap<String, Vec<String>>
pub fn paths(&self) -> &HashMap<String, Vec<String>>
List of file paths lowercased, with their casing counterparts. To quickly find files.
Sourcepub fn settings(&self) -> &PackSettings
pub fn settings(&self) -> &PackSettings
Settings stored in the Pack itself, to be able to share them between installations.
Source§impl Pack
impl Pack
Sourcepub fn disk_file_path_mut(&mut self) -> &mut String
pub fn disk_file_path_mut(&mut self) -> &mut String
The path of the Pack on disk, if exists. If not, then this should be empty.
Sourcepub fn disk_file_offset_mut(&mut self) -> &mut u64
pub fn disk_file_offset_mut(&mut self) -> &mut u64
The offset on the disk file the data of this Pack starts. Usually 0.
Sourcepub fn local_timestamp_mut(&mut self) -> &mut u64
pub fn local_timestamp_mut(&mut self) -> &mut u64
Timestamp from the moment this Pack was open. To check if the file was edited on disk while we had it open.
Sourcepub fn header_mut(&mut self) -> &mut PackHeader
pub fn header_mut(&mut self) -> &mut PackHeader
Header data of this Pack.
Sourcepub fn dependencies_mut(&mut self) -> &mut Vec<(bool, String)>
pub fn dependencies_mut(&mut self) -> &mut Vec<(bool, String)>
List of Packs this Pack depends on. If the boolean is true, the packs are also required to be loaded before himself when starting the game.
In other places, we may refer to this as the Dependency List.
Sourcepub fn paths_mut(&mut self) -> &mut HashMap<String, Vec<String>>
pub fn paths_mut(&mut self) -> &mut HashMap<String, Vec<String>>
List of file paths lowercased, with their casing counterparts. To quickly find files.
Sourcepub fn settings_mut(&mut self) -> &mut PackSettings
pub fn settings_mut(&mut self) -> &mut PackSettings
Settings stored in the Pack itself, to be able to share them between installations.
Source§impl Pack
impl Pack
Sourcepub fn set_disk_file_path(&mut self, val: String) -> &mut Self
pub fn set_disk_file_path(&mut self, val: String) -> &mut Self
The path of the Pack on disk, if exists. If not, then this should be empty.
Sourcepub fn set_disk_file_offset(&mut self, val: u64) -> &mut Self
pub fn set_disk_file_offset(&mut self, val: u64) -> &mut Self
The offset on the disk file the data of this Pack starts. Usually 0.
Sourcepub fn set_local_timestamp(&mut self, val: u64) -> &mut Self
pub fn set_local_timestamp(&mut self, val: u64) -> &mut Self
Timestamp from the moment this Pack was open. To check if the file was edited on disk while we had it open.
Sourcepub fn set_header(&mut self, val: PackHeader) -> &mut Self
pub fn set_header(&mut self, val: PackHeader) -> &mut Self
Header data of this Pack.
Sourcepub fn set_dependencies(&mut self, val: Vec<(bool, String)>) -> &mut Self
pub fn set_dependencies(&mut self, val: Vec<(bool, String)>) -> &mut Self
List of Packs this Pack depends on. If the boolean is true, the packs are also required to be loaded before himself when starting the game.
In other places, we may refer to this as the Dependency List.
Sourcepub fn set_files(&mut self, val: HashMap<String, RFile>) -> &mut Self
pub fn set_files(&mut self, val: HashMap<String, RFile>) -> &mut Self
List of files this Pack contains.
Sourcepub fn set_paths(&mut self, val: HashMap<String, Vec<String>>) -> &mut Self
pub fn set_paths(&mut self, val: HashMap<String, Vec<String>>) -> &mut Self
List of file paths lowercased, with their casing counterparts. To quickly find files.
Sourcepub fn set_notes(&mut self, val: PackNotes) -> &mut Self
pub fn set_notes(&mut self, val: PackNotes) -> &mut Self
Notes added to the Pack. Exclusive of this lib.
Sourcepub fn set_settings(&mut self, val: PackSettings) -> &mut Self
pub fn set_settings(&mut self, val: PackSettings) -> &mut Self
Settings stored in the Pack itself, to be able to share them between installations.
Source§impl Pack
Implementation of Pack.
impl Pack
Implementation of Pack.
Sourcepub fn new_with_version(pfh_version: PFHVersion) -> Self
pub fn new_with_version(pfh_version: PFHVersion) -> Self
This function creates a new empty Pack with a specific PFHVersion.
Sourcepub fn new_with_name_and_version(name: &str, pfh_version: PFHVersion) -> Self
pub fn new_with_name_and_version(name: &str, pfh_version: PFHVersion) -> Self
This function creates a new empty Pack with a name and a specific PFHVersion.
Sourcepub fn read_and_merge_ca_packs(
game: &GameInfo,
game_path: &Path,
) -> Result<Self>
pub fn read_and_merge_ca_packs( game: &GameInfo, game_path: &Path, ) -> Result<Self>
This function reads and returns all CA Packs for the provided game merged as one, for easy manipulation.
This needs a GameInfo to get the Packs from, and a game path to search the Packs on.
Sourcepub fn read_and_merge(
pack_paths: &[PathBuf],
game: &GameInfo,
lazy_load: bool,
ignore_mods: bool,
keep_order: bool,
) -> Result<Self>
pub fn read_and_merge( pack_paths: &[PathBuf], game: &GameInfo, lazy_load: bool, ignore_mods: bool, keep_order: bool, ) -> Result<Self>
Convenience function to open multiple Packs as one, taking care of overwriting files when needed.
If this function receives only one path, it works as a normal read_from_disk function. If it receives none, an error will be returned.
Sourcepub fn merge(packs: &[Self]) -> Result<Self>
pub fn merge(packs: &[Self]) -> Result<Self>
Convenience function to merge open Packs as one, taking care of overwriting files when needed.
Packs are merged in the order they are provided. If you need to use a custom order,
sort them before merging, or use the read_and_merge function instead.
Internal files are left in the state they were before. If you need them loaded, do it after this.
Sourcepub fn save(
&mut self,
path: Option<&Path>,
game_info: &GameInfo,
extra_data: &Option<EncodeableExtraData<'_>>,
) -> Result<()>
pub fn save( &mut self, path: Option<&Path>, game_info: &GameInfo, extra_data: &Option<EncodeableExtraData<'_>>, ) -> Result<()>
Convenience function to easily save a Pack to disk.
If a path is provided, the Pack will be saved to that path. Otherwise, it’ll use whatever path it had set before.
Sourcepub fn pfh_version(&self) -> PFHVersion
pub fn pfh_version(&self) -> PFHVersion
This function returns the current PFH Version of the provided Pack.
Sourcepub fn pfh_file_type(&self) -> PFHFileType
pub fn pfh_file_type(&self) -> PFHFileType
This function returns the current PFH File Type of the provided Pack.
Sourcepub fn bitmask(&self) -> PFHFlags
pub fn bitmask(&self) -> PFHFlags
This function returns the bitmask applied to the provided Pack.
Sourcepub fn internal_timestamp(&self) -> u64
pub fn internal_timestamp(&self) -> u64
This function returns the timestamp of the last time the Pack was saved.
Sourcepub fn game_version(&self) -> u32
pub fn game_version(&self) -> u32
This function returns the Game version this Pack is intended for.
Sourcepub fn build_number(&self) -> u32
pub fn build_number(&self) -> u32
This function returns the build number of the game this Pack is intended for.
This function returns the tool that created the Pack. Max 8 characters, 00-padded.
Sourcepub fn extra_subheader_data(&self) -> &[u8] ⓘ
pub fn extra_subheader_data(&self) -> &[u8] ⓘ
This function returns the Extra Subheader Data, if any.
Sourcepub fn compression_format(&self) -> CompressionFormat
pub fn compression_format(&self) -> CompressionFormat
This function returns the compression format of the Pack.
Sourcepub fn set_pfh_version(&mut self, version: PFHVersion)
pub fn set_pfh_version(&mut self, version: PFHVersion)
This function sets the current Pack PFH Version to the provided one.
Sourcepub fn set_pfh_file_type(&mut self, file_type: PFHFileType)
pub fn set_pfh_file_type(&mut self, file_type: PFHFileType)
This function sets the current Pack PFH File Type to the provided one.
Sourcepub fn set_bitmask(&mut self, bitmask: PFHFlags)
pub fn set_bitmask(&mut self, bitmask: PFHFlags)
This function sets the current Pack bitmask to the provided one.
Sourcepub fn set_internal_timestamp(&mut self, timestamp: u64)
pub fn set_internal_timestamp(&mut self, timestamp: u64)
This function sets the current Pack timestamp to the provided one.
Sourcepub fn set_game_version(&mut self, game_version: u32)
pub fn set_game_version(&mut self, game_version: u32)
This function sets the game version (as in X.Y.Z) this Pack is for.
Sourcepub fn set_build_number(&mut self, build_number: u32)
pub fn set_build_number(&mut self, build_number: u32)
This function sets the build number this Pack is for.
This function sets the authoring tool that last edited this Pack.
Sourcepub fn set_extra_subheader_data(&mut self, extra_subheader_data: &[u8])
pub fn set_extra_subheader_data(&mut self, extra_subheader_data: &[u8])
This function sets the Extra Subheader Data of the Pack.
Sourcepub fn set_compression_format(
&mut self,
cf: CompressionFormat,
game_info: &GameInfo,
) -> CompressionFormat
pub fn set_compression_format( &mut self, cf: CompressionFormat, game_info: &GameInfo, ) -> CompressionFormat
This function sets the compression format the pack should use.
Returns the new compression format. Support for each format varies depending on the game.
This function allows to toggle CA Authoring tool spoofing for this Pack.
Passing spoof as false will reset the Authoring Tool to the default one.
Sourcepub fn is_compressible(&self) -> bool
pub fn is_compressible(&self) -> bool
This function returns if the Pack is compressible or not.
Sourcepub fn missing_locs_paths(&self) -> (String, String)
pub fn missing_locs_paths(&self) -> (String, String)
This function returns the paths (as Strings) of the files used for missing loc data generation for the loaded Pack.
The first one is the one for existing entries. The second one is the one for new entries.
Sourcepub fn generate_missing_loc_data(
&mut self,
existing_locs: &HashMap<String, String>,
) -> Result<Vec<ContainerPath>>
pub fn generate_missing_loc_data( &mut self, existing_locs: &HashMap<String, String>, ) -> Result<Vec<ContainerPath>>
This function is used to generate all loc entries missing from a Pack into a missing.loc file.
Sourcepub fn patch_siege_ai(&mut self) -> Result<(String, Vec<ContainerPath>)>
pub fn patch_siege_ai(&mut self) -> Result<(String, Vec<ContainerPath>)>
This function is used to patch Warhammer I & II Siege map packs so their AI actually works.
This also removes the useless xml files left by Terry in the Pack.
Sourcepub fn live_export(
&mut self,
game: &GameInfo,
game_path: &Path,
disable_regen_table_guid: bool,
keys_first: bool,
) -> Result<()>
pub fn live_export( &mut self, game: &GameInfo, game_path: &Path, disable_regen_table_guid: bool, keys_first: bool, ) -> Result<()>
Function to perform a live extraction, meaning the files will be extracted while the game is running, allowing for real-time updates and modifications without the need for a full game restart.
Only works in Warhammer 3.
Sourcepub fn update_anim_ids(
&mut self,
game: &GameInfo,
starting_id: i32,
offset: i32,
) -> Result<Vec<ContainerPath>>
pub fn update_anim_ids( &mut self, game: &GameInfo, starting_id: i32, offset: i32, ) -> Result<Vec<ContainerPath>>
Function to update the anim ids of the pack on mass, based on a starting id and an offset.
Trait Implementations§
Source§impl Container for Pack
impl Container for Pack
Source§fn extract_metadata(&mut self, destination_path: &Path) -> Result<Vec<PathBuf>>
fn extract_metadata(&mut self, destination_path: &Path) -> Result<Vec<PathBuf>>
This method allows us to extract the metadata associated to the provided container as .json or .md files.
Pack implementation extracts the PackSettings of the provided Pack and its associated notes.
Source§fn move_path(
&mut self,
source_path: &ContainerPath,
destination_path: &ContainerPath,
) -> Result<Vec<(ContainerPath, ContainerPath)>>
fn move_path( &mut self, source_path: &ContainerPath, destination_path: &ContainerPath, ) -> Result<Vec<(ContainerPath, ContainerPath)>>
This function allows you to move any RFile of folder of RFiles from one folder to another.
It returns a list with all the new ContainerPath.
Source§fn disk_file_path(&self) -> &str
fn disk_file_path(&self) -> &str
Source§fn files(&self) -> &HashMap<String, RFile>
fn files(&self) -> &HashMap<String, RFile>
Source§fn files_mut(&mut self) -> &mut HashMap<String, RFile>
fn files_mut(&mut self) -> &mut HashMap<String, RFile>
Source§fn disk_file_offset(&self) -> u64
fn disk_file_offset(&self) -> u64
Source§fn paths_cache(&self) -> &HashMap<String, Vec<String>>
fn paths_cache(&self) -> &HashMap<String, Vec<String>>
Source§fn paths_cache_mut(&mut self) -> &mut HashMap<String, Vec<String>>
fn paths_cache_mut(&mut self) -> &mut HashMap<String, Vec<String>>
Source§fn internal_timestamp(&self) -> u64
fn internal_timestamp(&self) -> u64
Last modified date stored on the provided Container, in seconds. Read moreSource§fn local_timestamp(&self) -> u64
fn local_timestamp(&self) -> u64
Last modified date the filesystem reports for the container file, in seconds. Read moreSource§fn extract(
&mut self,
container_path: ContainerPath,
destination_path: &Path,
keep_container_path_structure: bool,
schema: &Option<Schema>,
case_insensitive: bool,
keys_first: bool,
extra_data: &Option<EncodeableExtraData<'_>>,
keep_data_in_memory: bool,
) -> Result<Vec<PathBuf>>
fn extract( &mut self, container_path: ContainerPath, destination_path: &Path, keep_container_path_structure: bool, schema: &Option<Schema>, case_insensitive: bool, keys_first: bool, extra_data: &Option<EncodeableExtraData<'_>>, keep_data_in_memory: bool, ) -> Result<Vec<PathBuf>>
Source§fn insert_file(
&mut self,
source_path: &Path,
container_path_folder: &str,
schema: &Option<Schema>,
) -> Result<Option<ContainerPath>>
fn insert_file( &mut self, source_path: &Path, container_path_folder: &str, schema: &Option<Schema>, ) -> Result<Option<ContainerPath>>
Source§fn insert_folder(
&mut self,
source_path: &Path,
container_path_folder: &str,
ignored_paths: &Option<Vec<&str>>,
schema: &Option<Schema>,
include_base_folder: bool,
) -> Result<Vec<ContainerPath>>
fn insert_folder( &mut self, source_path: &Path, container_path_folder: &str, ignored_paths: &Option<Vec<&str>>, schema: &Option<Schema>, include_base_folder: bool, ) -> Result<Vec<ContainerPath>>
Source§fn remove(&mut self, path: &ContainerPath) -> Vec<ContainerPath>
fn remove(&mut self, path: &ContainerPath) -> Vec<ContainerPath>
ContainerPath from the container. Read moreSource§fn disk_file_name(&self) -> String
fn disk_file_name(&self) -> String
Source§fn has_file(&self, path: &str) -> bool
fn has_file(&self, path: &str) -> bool
Source§fn has_folder(&self, path: &str) -> bool
fn has_folder(&self, path: &str) -> bool
Source§fn files_by_type(&self, file_types: &[FileType]) -> Vec<&RFile>
fn files_by_type(&self, file_types: &[FileType]) -> Vec<&RFile>
Source§fn files_by_type_mut(&mut self, file_types: &[FileType]) -> Vec<&mut RFile>
fn files_by_type_mut(&mut self, file_types: &[FileType]) -> Vec<&mut RFile>
Source§fn files_by_path(
&self,
path: &ContainerPath,
case_insensitive: bool,
) -> Vec<&RFile>
fn files_by_path( &self, path: &ContainerPath, case_insensitive: bool, ) -> Vec<&RFile>
ContainerPath. Read moreSource§fn files_by_path_mut(
&mut self,
path: &ContainerPath,
case_insensitive: bool,
) -> Vec<&mut RFile>
fn files_by_path_mut( &mut self, path: &ContainerPath, case_insensitive: bool, ) -> Vec<&mut RFile>
ContainerPath. Read moreSource§fn files_by_paths(
&self,
paths: &[ContainerPath],
case_insensitive: bool,
) -> Vec<&RFile>
fn files_by_paths( &self, paths: &[ContainerPath], case_insensitive: bool, ) -> Vec<&RFile>
ContainerPaths. Read moreSource§fn files_by_paths_mut(
&mut self,
paths: &[ContainerPath],
case_insensitive: bool,
) -> Vec<&mut RFile>
fn files_by_paths_mut( &mut self, paths: &[ContainerPath], case_insensitive: bool, ) -> Vec<&mut RFile>
ContainerPaths. Read moreSource§fn files_by_type_and_paths(
&self,
file_types: &[FileType],
paths: &[ContainerPath],
case_insensitive: bool,
) -> Vec<&RFile>
fn files_by_type_and_paths( &self, file_types: &[FileType], paths: &[ContainerPath], case_insensitive: bool, ) -> Vec<&RFile>
Source§fn files_by_type_and_paths_mut(
&mut self,
file_types: &[FileType],
paths: &[ContainerPath],
case_insensitive: bool,
) -> Vec<&mut RFile>
fn files_by_type_and_paths_mut( &mut self, file_types: &[FileType], paths: &[ContainerPath], case_insensitive: bool, ) -> Vec<&mut RFile>
Source§fn paths_cache_generate(&mut self)
fn paths_cache_generate(&mut self)
Source§fn paths_cache_insert_path(&mut self, path: &str)
fn paths_cache_insert_path(&mut self, path: &str)
Source§fn paths_cache_remove_path(&mut self, path: &str)
fn paths_cache_remove_path(&mut self, path: &str)
Source§fn paths_folders_raw(&self) -> HashSet<String>
fn paths_folders_raw(&self) -> HashSet<String>
Source§fn paths(&self) -> Vec<ContainerPath>
fn paths(&self) -> Vec<ContainerPath>
Source§fn paths_raw(&self) -> Vec<&str>
fn paths_raw(&self) -> Vec<&str>
Source§fn paths_raw_from_container_path(&self, path: &ContainerPath) -> Vec<String>
fn paths_raw_from_container_path(&self, path: &ContainerPath) -> Vec<String>
Source§fn preload(&mut self) -> Result<()>
fn preload(&mut self) -> Result<()>
Source§fn move_paths(
&mut self,
in_out_paths: &[(ContainerPath, ContainerPath)],
) -> Result<Vec<(ContainerPath, ContainerPath)>>
fn move_paths( &mut self, in_out_paths: &[(ContainerPath, ContainerPath)], ) -> Result<Vec<(ContainerPath, ContainerPath)>>
Source§fn clean_undecoded(&mut self)
fn clean_undecoded(&mut self)
Source§impl Decodeable for Pack
impl Decodeable for Pack
Source§impl<'de> Deserialize<'de> for Pack
impl<'de> Deserialize<'de> for Pack
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encodeable for Pack
impl Encodeable for Pack
Source§fn encode<W: WriteBytes>(
&mut self,
buffer: &mut W,
extra_data: &Option<EncodeableExtraData<'_>>,
) -> Result<()>
fn encode<W: WriteBytes>( &mut self, buffer: &mut W, extra_data: &Option<EncodeableExtraData<'_>>, ) -> Result<()>
impl StructuralPartialEq for Pack
Auto Trait Implementations§
impl Freeze for Pack
impl RefUnwindSafe for Pack
impl Send for Pack
impl Sync for Pack
impl Unpin for Pack
impl UnsafeUnpin for Pack
impl UnwindSafe for Pack
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.