pub struct Modpack {
pub pack_format: u16,
pub name: String,
pub summary: String,
pub author: String,
pub require_all: bool,
pub auto_dependencies: bool,
pub branches: Vec<String>,
pub projects: IndexMap<String, ProjectSettings>,
pub directory: PathBuf,
pub modpack_config_path: PathBuf,
}Expand description
Config file at the root of the project. File is named modpack.json.
Fields§
§pack_format: u16§name: String§summary: String§require_all: bool§auto_dependencies: bool§branches: Vec<String>§projects: IndexMap<String, ProjectSettings>§directory: PathBuf§modpack_config_path: PathBufImplementations§
Source§impl Modpack
impl Modpack
pub fn new(directory: &Path) -> Result<Self, PackrinthError>
pub fn from_directory(directory: &Path) -> Result<Self, PackrinthError>
pub fn add_projects( &mut self, projects: &[String], version_overrides: &Option<IndexMap<String, String>>, include_or_exclude: &Option<IncludeOrExclude>, )
pub fn add_project_override( &mut self, project: &str, branch: &str, project_version_id: &str, ) -> Result<(), PackrinthError>
pub fn remove_project_override( &mut self, project: &str, branch: &str, ) -> Result<(), PackrinthError>
pub fn remove_all_project_overrides( &mut self, project: &str, ) -> Result<(), PackrinthError>
pub fn add_project_inclusions( &mut self, project: &str, new_inclusions: &[String], ) -> Result<(), PackrinthError>
pub fn remove_project_inclusions( &mut self, project: &str, inclusions_to_remove: &[String], ) -> Result<(), PackrinthError>
pub fn remove_all_project_inclusions( &mut self, project: &str, ) -> Result<(), PackrinthError>
pub fn add_project_exclusions( &mut self, project: &str, new_exclusions: &[String], ) -> Result<(), PackrinthError>
pub fn remove_project_exclusions( &mut self, project: &str, exclusions_to_remove: &[String], ) -> Result<(), PackrinthError>
pub fn remove_all_project_exclusions( &mut self, project: &str, ) -> Result<(), PackrinthError>
pub fn remove_projects(&mut self, projects: &[String])
Sourcepub fn new_branch(
&mut self,
name: &String,
) -> Result<BranchConfig, PackrinthError>
pub fn new_branch( &mut self, name: &String, ) -> Result<BranchConfig, PackrinthError>
Creates new branches. If it already exists, it just returns the existing branch.
pub fn remove_branches(&mut self, branch_names: &Vec<String>)
pub fn save(&self) -> Result<(), PackrinthError>
pub fn export_branch(&self, branch: &String) -> Result<PathBuf, PackrinthError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Modpack
impl<'de> Deserialize<'de> for Modpack
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Modpack
impl RefUnwindSafe for Modpack
impl Send for Modpack
impl Sync for Modpack
impl Unpin for Modpack
impl UnwindSafe for Modpack
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