Module libpulse_binding::context::subscribe
source · Expand description
Daemon introspection event subscription subsystem.
Overview
The application can be notified, asynchronously, whenever the internal layout of the server
changes. The set of facilities and operations for which notifications are generated are
enumerated in Facility and Operation.
The application sets the notification mask using ::context::Context::subscribe and the
callback function that will be called whenever a notification occurs using
::context::Context::set_subscribe_callback.
The mask provided to ::context::Context::subscribe can be created by binary ORing a set of
values, either produced with Facility::to_interest_mask, or more simply with the provided
constants in the subscription_masks submodule.
The callback will be called with event type information representing the event that caused the
callback, detailing facility and operation, where for instance Facility::Source with
Operation::New indicates that a new source was added.
Example
Subscribe (declare interest):
use pulse::context::subscribe::subscription_masks;
let interest = subscription_masks::SINK |
subscription_masks::SOURCE;
let op = my_context.subscribe(
interest, // Our interest mask
None // We won’t bother with a success callback in this example
);Modules
Enums
Constants
Type Definitions
Context::subscribe. Convert a
Facility to a mask with facility_to_mask.