Expand description
Closure-friendly wrappers over the two cpdb-libs C callback shapes.
cpdb-libs has two callback types:
-
cpdb_printer_callback— fires when a printer is added, removed, or changes state. It carries nouser_data, so a thin-pointer Box trampoline cannot work. We use a global registry keyed on the frontend pointer; the trampoline looks the closure up by that key. -
cpdb_async_callback— completion forcpdbAcquireDetailsandcpdbAcquireTranslations. It does carryuser_data, so we use the standardBox<Box<dyn FnOnce>>thin-pointer trampoline.
Both trampolines wrap the user closure in catch_unwind so a Rust
panic does not unwind across the FFI boundary (which is UB).
Enums§
- Printer
Update - The change reported by a printer callback.