pub struct Core { /* private fields */ }Expand description
A singleton object representing the connection between the client and the PipeWire server.
Implementations§
Source§impl Core
impl Core
Sourcepub fn disconnect(&self)
pub fn disconnect(&self)
Disconnect connection with the PipeWire server. This will immediately trigger the removed
and destroy events on all tracked proxies. Callers should ensure that this will not
result in deadlocks with their own synchronisation primitives (for example, taking a lock
before disconnecting that is also taken in either of those callbacks).
Sourcepub fn add_listener(&self, events: CoreEvents) -> HookId
pub fn add_listener(&self, events: CoreEvents) -> HookId
Listen for events on the core object.
Sourcepub fn remove_listener(&self, hook_id: HookId)
pub fn remove_listener(&self, hook_id: HookId)
Remove a set of event listeners.
Sourcepub fn sync(&self) -> Result<u32>
pub fn sync(&self) -> Result<u32>
Trigger a sync message to the server, flushing all pending messages.
Sourcepub fn registry(&self) -> Result<Registry>
pub fn registry(&self) -> Result<Registry>
Retrieve a Registry. This can be used to query and track objects exposed by the server.
Sourcepub fn create_object(
&self,
factory_name: &str,
type_: &str,
version: u32,
props: &Properties,
) -> Result<Box<dyn HasProxy>>
pub fn create_object( &self, factory_name: &str, type_: &str, version: u32, props: &Properties, ) -> Result<Box<dyn HasProxy>>
Create an object of the given factory type on the server.
Trait Implementations§
Source§impl Refcounted for Core
impl Refcounted for Core
Source§fn upgrade(this: &Self::WeakRef) -> Option<Self>
fn upgrade(this: &Self::WeakRef) -> Option<Self>
Try to convert a weak reference to a strong reference. If the underlying object isstill
alive, returns a
Some continaing the value. If the underlying object’s strong reference
count dropped to zero, and was thus freed, this returns None.Source§fn downgrade(&self) -> Self::WeakRef
fn downgrade(&self) -> Self::WeakRef
Create a weak reference to the object. This reference does not impact the object’s
lifecycle, and merely allows us the option to try to retrieve the object using
Self::upgrade().
impl Send for Core
impl Sync for Core
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more