Struct physis::cfg::ConfigFile
source · pub struct ConfigFile {
pub categories: Vec<String>,
pub settings: HashMap<String, ConfigMap>,
}
Expand description
Represents a config file, which is made up of categories and settings. Categories may have zero to one setting.
Fields§
§categories: Vec<String>
The categories present in this config file.
settings: HashMap<String, ConfigMap>
A mapping of category to keys.
Implementations§
source§impl ConfigFile
impl ConfigFile
sourcepub fn from_existing(buffer: ByteSpan<'_>) -> Option<ConfigFile>
pub fn from_existing(buffer: ByteSpan<'_>) -> Option<ConfigFile>
Parses an existing config file.
sourcepub fn write_to_buffer(&self) -> Option<ByteBuffer>
pub fn write_to_buffer(&self) -> Option<ByteBuffer>
Writes an existing config file to a buffer.
sourcepub fn has_key(&self, select_key: &str) -> bool
pub fn has_key(&self, select_key: &str) -> bool
Checks if the CFG contains a key named select_key
sourcepub fn has_category(&self, select_category: &str) -> bool
pub fn has_category(&self, select_category: &str) -> bool
Checks if the CFG contains a category named select_category
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnwindSafe for ConfigFile
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