pub struct PackSettings { /* private fields */ }Expand description
Pack-specific settings stored within the pack itself.
These settings are serialized to a reserved file within the pack, allowing them to be shared when the pack is distributed. Common settings include compression format, diagnostic ignore lists, and import configurations.
§Built-in Settings
compression_format: The compression format to use (None, Lz4, Zlib)diagnostics_files_to_ignore: Files/diagnostics to skip during validationimport_files_to_ignore: Files to skip during folder importsdisable_autosaves: Disable automatic savingdo_not_generate_existing_locs: Skip generating loc entries that already exist
Implementations§
Source§impl PackSettings
impl PackSettings
Sourcepub fn settings_text(&self) -> &BTreeMap<String, String>
pub fn settings_text(&self) -> &BTreeMap<String, String>
Multi-line text settings (e.g., file ignore lists).
Sourcepub fn settings_string(&self) -> &BTreeMap<String, String>
pub fn settings_string(&self) -> &BTreeMap<String, String>
Single-line string settings (e.g., compression format).
Sourcepub fn settings_bool(&self) -> &BTreeMap<String, bool>
pub fn settings_bool(&self) -> &BTreeMap<String, bool>
Boolean flag settings (e.g., disable_autosaves).
Sourcepub fn settings_number(&self) -> &BTreeMap<String, i32>
pub fn settings_number(&self) -> &BTreeMap<String, i32>
Integer settings (e.g., thresholds, limits).
Source§impl PackSettings
impl PackSettings
Sourcepub fn settings_text_mut(&mut self) -> &mut BTreeMap<String, String>
pub fn settings_text_mut(&mut self) -> &mut BTreeMap<String, String>
Multi-line text settings (e.g., file ignore lists).
Sourcepub fn settings_string_mut(&mut self) -> &mut BTreeMap<String, String>
pub fn settings_string_mut(&mut self) -> &mut BTreeMap<String, String>
Single-line string settings (e.g., compression format).
Sourcepub fn settings_bool_mut(&mut self) -> &mut BTreeMap<String, bool>
pub fn settings_bool_mut(&mut self) -> &mut BTreeMap<String, bool>
Boolean flag settings (e.g., disable_autosaves).
Sourcepub fn settings_number_mut(&mut self) -> &mut BTreeMap<String, i32>
pub fn settings_number_mut(&mut self) -> &mut BTreeMap<String, i32>
Integer settings (e.g., thresholds, limits).
Source§impl PackSettings
impl PackSettings
Sourcepub fn set_settings_text(&mut self, val: BTreeMap<String, String>) -> &mut Self
pub fn set_settings_text(&mut self, val: BTreeMap<String, String>) -> &mut Self
Multi-line text settings (e.g., file ignore lists).
Sourcepub fn set_settings_string(
&mut self,
val: BTreeMap<String, String>,
) -> &mut Self
pub fn set_settings_string( &mut self, val: BTreeMap<String, String>, ) -> &mut Self
Single-line string settings (e.g., compression format).
Sourcepub fn set_settings_bool(&mut self, val: BTreeMap<String, bool>) -> &mut Self
pub fn set_settings_bool(&mut self, val: BTreeMap<String, bool>) -> &mut Self
Boolean flag settings (e.g., disable_autosaves).
Sourcepub fn set_settings_number(&mut self, val: BTreeMap<String, i32>) -> &mut Self
pub fn set_settings_number(&mut self, val: BTreeMap<String, i32>) -> &mut Self
Integer settings (e.g., thresholds, limits).
Source§impl PackSettings
impl PackSettings
Sourcepub fn load(data: &[u8]) -> Result<Self>
pub fn load(data: &[u8]) -> Result<Self>
This function tries to load the settings from a slice and return them.
Sourcepub fn load_and_update(&mut self, data: &[u8]) -> Result<()>
pub fn load_and_update(&mut self, data: &[u8]) -> Result<()>
This function tries to load the settings from a slice, update them so they don’t have any missing values and return them.
Sourcepub fn setting_string(&self, key: &str) -> Option<&String>
pub fn setting_string(&self, key: &str) -> Option<&String>
This function returns the provided string setting, if found.
Sourcepub fn setting_text(&self, key: &str) -> Option<&String>
pub fn setting_text(&self, key: &str) -> Option<&String>
This function returns the provided text setting (multiline string), if found.
Sourcepub fn setting_bool(&self, key: &str) -> Option<&bool>
pub fn setting_bool(&self, key: &str) -> Option<&bool>
This function returns the provided bool setting, if found.
Sourcepub fn setting_number(&self, key: &str) -> Option<&i32>
pub fn setting_number(&self, key: &str) -> Option<&i32>
This function returns the provided numeric setting, if found.
Sourcepub fn set_setting_string(&mut self, key: &str, value: &str)
pub fn set_setting_string(&mut self, key: &str, value: &str)
This function sets the string setting provided with the value you passed.
If the value already existed, it gets overwritten.
Sourcepub fn set_setting_text(&mut self, key: &str, value: &str)
pub fn set_setting_text(&mut self, key: &str, value: &str)
This function sets the text (multiline string) setting provided with the value you passed.
If the value already existed, it gets overwritten.
Sourcepub fn set_setting_bool(&mut self, key: &str, value: bool)
pub fn set_setting_bool(&mut self, key: &str, value: bool)
This function sets the bool setting provided with the value you passed.
If the value already existed, it gets overwritten.
Sourcepub fn set_setting_number(&mut self, key: &str, value: i32)
pub fn set_setting_number(&mut self, key: &str, value: i32)
This function sets the numeric setting provided with the value you passed.
If the value already existed, it gets overwritten.
Trait Implementations§
Source§impl Clone for PackSettings
impl Clone for PackSettings
Source§fn clone(&self) -> PackSettings
fn clone(&self) -> PackSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackSettings
impl Debug for PackSettings
Source§impl Default for PackSettings
impl Default for PackSettings
Source§impl<'de> Deserialize<'de> for PackSettings
impl<'de> Deserialize<'de> for PackSettings
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 PartialEq for PackSettings
impl PartialEq for PackSettings
Source§impl Serialize for PackSettings
impl Serialize for PackSettings
impl Eq for PackSettings
impl StructuralPartialEq for PackSettings
Auto Trait Implementations§
impl Freeze for PackSettings
impl RefUnwindSafe for PackSettings
impl Send for PackSettings
impl Sync for PackSettings
impl Unpin for PackSettings
impl UnsafeUnpin for PackSettings
impl UnwindSafe for PackSettings
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.