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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

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

Returns true if the dict is empty, false if it is not.

Returns the bitflags that are set for the dict.

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

Insert the key-value pair, overwriting any old value.

Remove the key-value pair if it exists.

Clear the object, removing all key-value pairs.

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.