pub struct CoreInner { /* private fields */ }
Implementations
sourceimpl CoreInner
impl CoreInner
pub fn add_listener_local(&self) -> ListenerLocalBuilder<'_>
pub fn get_registry(&self) -> Result<Registry, Error>
pub fn sync(&self, seq: i32) -> Result<AsyncSeq, Error>
sourcepub fn create_object<P: ProxyT, D: ReadableDict>(
&self,
factory_name: &str,
properties: &D
) -> Result<P, Error>
pub fn create_object<P: ProxyT, D: ReadableDict>(
&self,
factory_name: &str,
properties: &D
) -> Result<P, Error>
Create a new object on the PipeWire server from a factory.
You will need specify what type you are expecting to be constructed by either using type inference or the turbofish syntax.
Parameters
factory_name
the name of the factory to useproperties
extra properties that the new object will have
Panics
If factory_name
contains a null byte.
Returns
One of:
Ok(P)
on success, whereP
is the newly created objectErr(Error::CreationFailed)
if the object could not be createdErr(Error::WrongProxyType)
if the created type does not match the typeP
that the user is trying to create
Examples
Creating a new link:
ⓘ
use pipewire as pw;
pw::init();
let mainloop = pw::MainLoop::new().expect("Failed to create Pipewire Mainloop");
let context = pw::Context::new(&mainloop).expect("Failed to create Pipewire Context");
let core = context
.connect(None)
.expect("Failed to connect to Pipewire Core");
// This call uses turbofish syntax to specify that we want a link.
let link = core.create_object::<pw::link::Link, _>(
// The actual name for a link factory might be different for your system,
// you should probably obtain a factory from the registry.
"link-factory",
&pw::properties! {
"link.output.port" => "1",
"link.input.port" => "2",
"link.output.node" => "3",
"link.input.node" => "4"
},
)
.expect("Failed to create object");
See pipewire/examples/create-delete-remote-objects.rs
in the crates repository for a more detailed example.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CoreInner
impl !Send for CoreInner
impl !Sync for CoreInner
impl Unpin for CoreInner
impl UnwindSafe for CoreInner
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more