Struct pipewire::Properties [−][src]
pub struct Properties { /* fields omitted */ }
Expand description
A collection of key/value pairs.
Examples
Create a Properties
struct and access the stored values by key:
use pipewire::prelude::*;
use pipewire::{properties, Properties};
let props = properties!{
"Key" => "Value",
"OtherKey" => "OtherValue"
};
assert_eq!(Some("Value"), props.get("Key"));
assert_eq!(Some("OtherValue"), props.get("OtherKey"));
Implementations
Create a Properties
struct from an existing raw pw_properties
pointer.
Safety
- The provided pointer must point to a valid, well-aligned
pw_properties
struct. - After this call, the generated
Properties
struct will assume ownership of the data pointed to, so that data must not be freed elsewhere.
Obtain a pointer to the underlying pw_properties
struct.
The pointer is only valid for the lifetime of the Properties
struct the pointer was obtained from,
and must not be dereferenced after it is dropped.
Ownership of the pw_properties
struct is not transferred to the caller and must not be manually freed.
If you want to take ownership, use into_raw() instead.
Consume the Properties
struct, returning a pointer to the raw pw_properties
struct.
After this function, the caller is responsible for pw_properties
struct,
and should make sure it is freed when it is no longer needed.
Create a new Properties
from a given dictionary.
All the keys and values from dict
are copied.
Trait Implementations
Obtain the pointer to the raw spa_dict
struct.
An iterator over all raw key-value pairs.
The iterator element type is (&CStr, &CStr)
. Read more
An iterator over all key-value pairs that are valid utf-8.
The iterator element type is (&str, &str)
. Read more
An iterator over all keys that are valid utf-8. The iterator element type is &str. Read more
An iterator over all values that are valid utf-8. The iterator element type is &str. Read more
Returns the number of key-value-pairs in the dict. This is the number of all pairs, not only pairs that are valid-utf8. Read more
Get the value associated with the provided key. Read more
Get the value associated with the provided key and convert it to a given type. Read more
Auto Trait Implementations
impl RefUnwindSafe for Properties
impl !Send for Properties
impl !Sync for Properties
impl Unpin for Properties
impl UnwindSafe for Properties
Blanket Implementations
Mutably borrows from an owned value. Read more