The crate structure is close to the PipeWire API structure, so PipeWire Documentation can be used to clarify some aspects of the bindings.
use pipewire_wrapper::core_api::main_loop::MainLoop;
use std::time::Duration;
let main_loop = MainLoop::default();
let callback = |_expirations| {
main_loop.quit().unwrap();
};
let timer = main_loop.get_loop().add_timer(Box::new(callback)).unwrap();
main_loop
.get_loop()
.update_timer(&timer, Duration::from_secs(1), Duration::ZERO, false)
.unwrap();
main_loop.run().unwrap();
More examples can be found in examples
folder.
key: value
pairs to struct with constants.build
method for Events struct builder.build
method for Events struct channel builder.ref_: Proxy<'c>
field.
Macros parameter will be used as target type to cast underlying proxy.#[raw]
attribute must be added before field with wrapped raw value.#[raw_wrapper]
attribute must be added before field with NonNull<impl RawWrapper>
pointer to *Ref
struct, that implements RawWrapper