ini
17 items · generated by scribe fromstdlib/ini.fd· synced 2026-11-15
Contents
- IniEntry (struct)
- ini_parse (function)
- ini_get (function)
- ini_has (function)
- ini_get_int (function)
- ini_get_float (function)
- ini_get_bool (function)
- ini_sections (function)
- ini_keys (function)
- ini_set (function)
- ini_serialize (function)
IniEntry
One key = value line inside a section.
pub struct IniEntry {Fields:
| Name | Type |
|---|---|
section | str |
key | str |
value | str |
Defined at line 20
ini_parse
Parse INI text into a Vec
pub fn ini_parse(text: str) -> Vec<IniEntry> {Parameters:
text:str
Returns: Vec<IniEntry>
Defined at line 73
ini_get
Value for key in section ("" for global), or "" if absent.
pub fn ini_get(doc: Vec<IniEntry>, section: str, key: str) -> str {Parameters:
doc:Vec<IniEntry>section:strkey:str
Returns: str
Defined at line 135
ini_has
True if (section, key) exists.
pub fn ini_has(doc: Vec<IniEntry>, section: str, key: str) -> bool {Parameters:
doc:Vec<IniEntry>section:strkey:str
Returns: bool
Defined at line 148
ini_get_int
Value parsed as int; default when absent or non-numeric.
pub fn ini_get_int(doc: Vec<IniEntry>, section: str, key: str, default: i64) -> i64 {Parameters:
doc:Vec<IniEntry>section:strkey:strdefault:i64
Returns: i64
Defined at line 161
ini_get_float
Value parsed as float; default when absent or non-numeric.
pub fn ini_get_float(doc: Vec<IniEntry>, section: str, key: str, default: f64) -> f64 {Parameters:
doc:Vec<IniEntry>section:strkey:strdefault:f64
Returns: f64
Defined at line 170
ini_get_bool
Value parsed as bool: true/yes/on/1 (case-insensitive) are true; false/no/off/0 are false; default otherwise or when absent.
pub fn ini_get_bool(doc: Vec<IniEntry>, section: str, key: str, default: bool) -> bool {Parameters:
doc:Vec<IniEntry>section:strkey:strdefault:bool
Returns: bool
Defined at line 180
ini_sections
List of section names in document order (excluding the global "").
pub fn ini_sections(doc: Vec<IniEntry>) -> Vec<str> {Parameters:
doc:Vec<IniEntry>
Returns: Vec<str>
Defined at line 192
ini_keys
All keys inside section in document order.
pub fn ini_keys(doc: Vec<IniEntry>, section: str) -> Vec<str> {Parameters:
doc:Vec<IniEntry>section:str
Returns: Vec<str>
Defined at line 206
ini_set
Set key in section to value; replaces the first existing entry in-place, appends at the end otherwise.
pub fn ini_set(doc: & mut Vec<IniEntry>, section: str, key: str, value: str) -> void {Parameters:
doc:& mut Vec<IniEntry>section:strkey:strvalue:str
Returns: void
Defined at line 223
ini_serialize
Serialize back to INI text. Global keys come first; entries keep the order they appear in doc, grouped under section headers as they occur.
pub fn ini_serialize(doc: Vec<IniEntry>) -> str {Parameters:
doc:Vec<IniEntry>
Returns: str
Defined at line 252
Generated by scribe, the Fides documentation generator