[−][src]Struct libpulse_binding::proplist::Proplist
A property list object. Basically a dictionary with ASCII strings as keys and arbitrary data as values.
Methods
impl Proplist
[src]
pub fn new() -> Option<Self>
[src]
Allocates a property list.
pub fn new_from_string(s: &str) -> Option<Self>
[src]
Allocates a new property list and assigns key/value from a human readable string.
pub fn key_is_valid(key: &str) -> bool
[src]
Checks if the key is valid.
pub fn set_str(&mut self, key: &str, value: &str) -> Result<(), ()>
[src]
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.
pub fn sets(&mut self, key: &str, value: &str) -> Result<(), ()>
[src]
sets()
has been renamed to set_str()
pub fn set_pl(&mut self, pair: &str) -> Result<(), ()>
[src]
Appends a new string entry to the property list, possibly overwriting an already existing entry with the same key.
This is similar to set_strs
, 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.
pub fn setp(&mut self, pair: &str) -> Result<(), ()>
[src]
setp()
has been renamed to set_pl()
pub fn set(&mut self, key: &str, data: &[u8]) -> Result<(), ()>
[src]
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.
pub fn get_str(&self, key: &str) -> Option<String>
[src]
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.
pub fn gets(&self, key: &str) -> Option<String>
[src]
gets()
has been renamed to get_str()
pub fn get(&self, key: &str) -> Option<&[u8]>
[src]
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 the property list is accessed again.
Returns a slice formed from the data pointer and the length of the data.
Returns None
if key does not exist.
pub fn merge(&mut self, other: &Self, mode: UpdateMode)
[src]
Merges property list “other” into self, adhering to the merge mode specified.
pub fn unset(&mut self, key: &str) -> Result<(), PAErr>
[src]
Removes a single entry from the property list, identified by the specified key name.
pub fn unset_many(&mut self, keys: &[&str]) -> Option<u32>
[src]
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).
pub fn iter(&self) -> Iterator
[src]
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); }
pub fn to_string(&self) -> Option<String>
[src]
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.
pub fn to_string_sep(&self, sep: &str) -> Option<String>
[src]
Formats the property list nicely as a human readable string, choosing the separator used.
pub fn contains(&self, key: &str) -> Option<bool>
[src]
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.
pub fn clear(&mut self)
[src]
Removes all entries from the property list object.
pub fn len(&self) -> u32
[src]
Gets the number of entries in the property list.
pub fn is_empty(&self) -> bool
[src]
Checks if the proplist is empty.
pub fn equal_to(&self, to: &Self) -> bool
[src]
use the PartialEq
implementation instead
Checks if self and to
have the same keys and values.
Trait Implementations
impl Clone for Proplist
[src]
fn clone(&self) -> Self
[src]
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.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Proplist
[src]
impl IntoIterator for Proplist
[src]
type Item = String
The type of the elements being iterated over.
type IntoIter = Iterator<'static>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<Proplist> for Proplist
[src]
impl Send for Proplist
[src]
impl Sync for Proplist
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,