Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Build (all targets)
run: cargo build --all-targets --verbose
run: cargo build --all-targets --all-features --verbose

- name: Clippy
run: cargo clippy --all-targets -- -D warnings

- name: Run tests
- name: Run unit tests
env:
LD_LIBRARY_PATH: /usr/lib:/usr/local/lib
run: cargo test --all --verbose -- --nocapture
run: cargo test --all-targets --all-features --verbose

- name: D-Bus smoke test (ignored integration tests)
env:
Expand All @@ -72,7 +72,7 @@ jobs:
run: dbus-launch --exit-with-session cargo test --test integration -- --ignored --nocapture

- name: Build examples
run: cargo build --examples --verbose
run: cargo build --examples --all-features --verbose

docs:
name: Documentation
Expand All @@ -99,7 +99,7 @@ jobs:
- name: Docs
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps -p cpdb-rs
run: cargo doc --no-deps -p cpdb-rs --all-features

audit:
name: Security audit
Expand Down Expand Up @@ -195,4 +195,6 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Build Rust library (bindgen + compile, no link)
run: cargo build --lib --verbose
run: cargo build --lib --all-features --verbose


9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING:** The C-FFI interface is behind the `ffi` feature flag and has been moved to the underlying `cpdb-sys` crate. The default feature is now `zbus-backend`.
- **BREAKING:** `Printer` now carries a lifetime parameter tied to its
`Frontend`. Borrowed printers cannot outlive their frontend — the borrow
checker enforces this. `Printer::load_from_file` returns a `Printer<'static>`.
Expand Down Expand Up @@ -54,6 +55,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `CpdbClient`: The new main entrypoint for the async native D-Bus client.
- `CpdbClient::get_all_printers`: Fetches a snapshot of all active printers across all discovered backends.
- `CpdbClient::get_printer_details`: Fetches options and media sizes for a specific printer.
- `CpdbClient::discovery_stream`: Exposes a native `Stream` of `DiscoveryEvent`s (`PrinterAdded`, `PrinterRemoved`, `PrinterStateChanged`) for live discovery.
- `CpdbClient::keep_alive_all`: Helper method to ping all connected backends and prevent them from auto-exiting due to inactivity timeouts.
- `Frontend::new_with_observer<F: FnMut(&Printer, PrinterUpdate) + Send + 'static>` —
closure-based registration for the `cpdb_printer_callback`. Backed by a
process-global pointer-keyed registry and unregistered automatically when
Expand Down Expand Up @@ -101,6 +107,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Infrastructure

- Native Rust D-Bus Client: Completely rewrote the crate to use native Rust D-Bus bindings via `zbus`, dropping the dependency on the `cpdb-libs` C library for the primary API.
- Async API: All frontend APIs are now fully asynchronous and powered by `tokio`.
- Legacy FFI: The old C-FFI bindings are still available but have been moved behind the optional `ffi` feature flag.
- `build.rs` now prefers `pkg-config` over the hard-coded fallback path
list, drops the architecture-specific `/usr/lib/x86_64-linux-gnu` guess,
and emits a `cargo:warning` when neither pkg-config nor `CPDB_LIBS_PATH`
Expand Down
Loading
Loading