logo
pub struct Proplist(_);
Expand description

A property list object. Basically a dictionary with ASCII strings as keys and arbitrary data as values.

Implementations

Allocates a property list.

Allocates a new property list and assigns key/value from a human readable string.

Checks if the key is valid.

Appends a new string entry to the property list, possibly overwriting an already existing entry with the same key.

An internal copy is made of the provided string.

Appends a new string entry to the property list, possibly overwriting an already existing entry with the same key.

This is similar to set_str(), however here the provided key and value are combined into a single string, separated by an =. An internal copy is made of the provided string.

Appends a new arbitrary data entry to the property list, possibly overwriting an already existing entry with the same key.

An internal copy of the provided data is made.

Gets a string entry for the specified key.

Will return None if the key does not exist or if data is not valid UTF-8.

Gets the value for the specified key.

For string entries, the value store will be NUL-terminated.

The caller should make a copy of the data before any subsequent modification or destruction of the property list.

Returns a slice formed from the data pointer and the length of the data. Returns None if key does not exist.

Merges property list “other” into self, adhering to the merge mode specified.

Removes a single entry from the property list, identified by the specified key name.

Similar to unset() but takes an array of keys to remove.

Returns None on failure, otherwise the number of entries actually removed (which might even be 0, if there were no matching entries to remove).

Gets an immutable iterator over the list’s keys.

The property list should not be modified during iteration through the list, with the exception of deleting the current entry. The keys in the property list do not have any particular order.

for key in my_props.iter() {
    //do something with it
    println!("key: {}", key);
}

Formats the property list nicely as a human readable string.

This works very much like to_string_sep() and uses a newline as separator and appends one final one.

Formats the property list nicely as a human readable string, choosing the separator used.

Checks if this contains an entry with the given key.

Returns true if an entry for the specified key exists in the property list. Returns None on error.

Removes all entries from the property list object.

Gets the number of entries in the property list.

Checks if the proplist is empty.

Trait Implementations

Allocates a new property list and copy over every single entry from the specified list.

If this is called on a ‘weak’ instance, a non-weak object is returned.

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

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

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.