Struct physis::repository::Repository
source · pub struct Repository {
pub name: String,
pub platform: Platform,
pub repo_type: RepositoryType,
pub version: Option<String>,
}
Expand description
Encapsulates a directory of game data, such as “ex1”. This data is also versioned.
This handles calculating the correct dat and index filenames, mainly for GameData
.
Fields§
§name: String
The folder name, such as “ex1”.
platform: Platform
The platform this repository is designed for.
repo_type: RepositoryType
The type of repository, such as “base game” or “expansion”.
version: Option<String>
The version of the game data.
Implementations§
source§impl Repository
impl Repository
sourcepub fn from_existing_base(platform: Platform, dir: &str) -> Option<Repository>
pub fn from_existing_base(platform: Platform, dir: &str) -> Option<Repository>
Creates a new base Repository
, from an existing directory. This may return None
if
the directory is invalid, e.g. a version file is missing.
sourcepub fn from_existing_expansion(
platform: Platform,
dir: &str,
) -> Option<Repository>
pub fn from_existing_expansion( platform: Platform, dir: &str, ) -> Option<Repository>
Creates a new expansion Repository
, from an existing directory. This may return None
if
the directory is invalid, e.g. a version file is missing.
sourcepub fn index_filename(&self, chunk: u8, category: Category) -> String
pub fn index_filename(&self, chunk: u8, category: Category) -> String
Calculate an index filename for a specific category, like “0a0000.win32.index”.
sourcepub fn index2_filename(&self, chunk: u8, category: Category) -> String
pub fn index2_filename(&self, chunk: u8, category: Category) -> String
Calculate an index2 filename for a specific category, like “0a0000.win32.index”.
Trait Implementations§
source§impl Clone for Repository
impl Clone for Repository
source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Repository
impl Debug for Repository
source§impl Ord for Repository
impl Ord for Repository
source§impl PartialEq for Repository
impl PartialEq for Repository
source§impl PartialOrd for Repository
impl PartialOrd for Repository
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Repository
Auto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)