#[repr(transparent)]
pub struct KeyFile { /* private fields */ }

Implementations

Available on crate feature v2_56 only.
Available on crate feature v2_50 only.

Associates a new boolean value with key under group_name. If key cannot be found then it is created.

group_name

a group name

key

a key

value

true or false

Places a comment above key from group_name.

If key is None then comment will be written above group_name. If both key and group_name are None, then comment will be written above the first group in the file.

Note that this function prepends a ‘#’ comment marker to each line of comment.

group_name

a group name, or None

key

a key

comment

a comment

Returns

true if the comment was written, false otherwise

Associates a new double value with key under group_name. If key cannot be found then it is created.

group_name

a group name

key

a key

value

a double value

Associates a new integer value with key under group_name. If key cannot be found then it is created.

group_name

a group name

key

a key

value

an integer value

Associates a new integer value with key under group_name. If key cannot be found then it is created.

group_name

a group name

key

a key

value

an integer value

Sets the character which is used to separate values in lists. Typically ‘;’ or ‘,’ are used as separators. The default list separator is ‘;’.

separator

the separator

Associates a string value for key and locale under group_name. If the translation for key cannot be found then it is created.

group_name

a group name

key

a key

locale

a locale identifier

string

a string

Associates a new string value with key under group_name. If key cannot be found then it is created. If group_name cannot be found then it is created. Unlike set_value(), this function handles characters that need escaping, such as newlines.

group_name

a group name

key

a key

string

a string

Associates a new integer value with key under group_name. If key cannot be found then it is created.

group_name

a group name

key

a key

value

an integer value

Associates a new value with key under group_name.

If key cannot be found then it is created. If group_name cannot be found then it is created. To set an UTF-8 string which may contain characters that need escaping (such as newlines or spaces), use set_string().

group_name

a group name

key

a key

value

a string

This function outputs self as a string.

Note that this function never reports an error, so it is safe to pass None as error.

Returns

a newly allocated string holding the contents of the KeyFile

length

return location for the length of the returned string, or None

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Ensures that the type has been registered with the type system.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.