Skip to content

stdlib/iniView source ↗

ini

17 items · generated by scribe fromstdlib/ini.fd· synced 2026-11-15

stdlib/ini17 items

Contents

IniEntry

One key = value line inside a section.

pub struct IniEntry {

Fields:

NameType
sectionstr
keystr
valuestr

Defined at line 20


ini_parse

Parse INI text into a Vecpreserving document order.

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: str
  • key: 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: str
  • key: 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: str
  • key: str
  • default: 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: str
  • key: str
  • default: 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: str
  • key: str
  • default: 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: str
  • key: str
  • value: 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