feat(client): gate native backends behind Cargo features and add ConfigBuilder#1338
Draft
Benoît Cortier (CBenoit) wants to merge 2 commits into
Draft
feat(client): gate native backends behind Cargo features and add ConfigBuilder#1338Benoît Cortier (CBenoit) wants to merge 2 commits into
Benoît Cortier (CBenoit) wants to merge 2 commits into
Conversation
…igBuilder
Cargo features
* `default = []`; consumers now opt into exactly what they need.
* New matrix: `sound`, `clipboard`, `rdpdr`, `smartcard`, `gateway`,
`qoi`, `qoiz`, `dvc-pipe-proxy`, `dvc-com-plugin`, plus the
existing `rustls` / `native-tls` selection.
* `ironrdp-rdpsnd-native`, `ironrdp-cliprdr-native`, `ironrdp-mstsgu`,
`reqwest`, `ironrdp-dvc-pipe-proxy`, and `ironrdp-dvc-com-plugin`
become optional and are only pulled in by the matching feature.
* Native backend instantiation (cpal RDPSND, native clipboard,
NoopRdpdrBackend, Windows COM DVC plugin, gateway/WS transport)
moves into the library behind those `cfg`s, with
`with_<feature>_backend(custom)` escape hatches.
Public API
* Introduce `Config` + `ConfigBuilder` with typed fields and
per-feature runtime toggles (`with_sound(bool)`,
`with_clipboard(bool)`, ...). Setters always compile and are
documented no-ops when the matching Cargo feature is disabled,
so generic embedders don't need to sprinkle `cfg!`.
* Drop `PartialConfig` from the library's public surface; `.rdp` /
`PropertySet` / clap / inquire parsing now lives entirely in the
viewer and produces a `Config` directly.
There was a problem hiding this comment.
Pull request overview
This PR refactors ironrdp-client to make protocol/native backends opt-in via Cargo features (no default features) and introduces a typed Config/ConfigBuilder API, while moving .rdp/CLI parsing responsibilities into the viewer frontend.
Changes:
- Add
Config,Features, andConfigBuilderinironrdp-client, including runtime feature gates (with_sound(bool),with_clipboard(bool), etc.). - Gate optional channel wiring (sound/clipboard/rdpdr/gateway/DVC integrations) behind Cargo features in the client engine.
- Update
ironrdp-viewerto parse inputs in two phases (parse_inputs+build_config) and wire clipboard backend factories into the new config.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/ironrdp-viewer/src/main.rs | Switch to new parsing/build flow and wire clipboard backend factory into Config. |
| crates/ironrdp-viewer/src/config.rs | Replace PartialConfig with ParsedInputs + build_config using ConfigBuilder. |
| crates/ironrdp-viewer/Cargo.toml | Enable new ironrdp-client feature matrix and add needed deps/features wiring. |
| crates/ironrdp-client/src/rdp.rs | Gate imports/channel wiring behind features; refactor connection setup and optional channels. |
| crates/ironrdp-client/src/lib.rs | Re-export PropertySet for consumers/frontends. |
| crates/ironrdp-client/src/config.rs | Introduce ConfigBuilder, runtime feature flags, and backend override slots. |
| crates/ironrdp-client/Cargo.toml | Remove default features; add feature matrix and optional deps. |
| Cargo.lock | Lockfile updates for new deps (whoami, ironrdp-propertyset, ironrdp-cfg, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cargo features
default = []; consumers now opt into exactly what they need.sound,clipboard,rdpdr,smartcard,gateway,qoi,qoiz,dvc-pipe-proxy,dvc-com-plugin, plus the existingrustls/native-tlsselection.ironrdp-rdpsnd-native,ironrdp-cliprdr-native,ironrdp-mstsgu,reqwest,ironrdp-dvc-pipe-proxy, andironrdp-dvc-com-pluginbecome optional and are only pulled in by the matching feature.cfgs, withwith_<feature>_backend(custom)escape hatches.Public API
Config+ConfigBuilderwith typed fields and per-feature runtime toggles (with_sound(bool),with_clipboard(bool), ...). Setters always compile and are documented no-ops when the matching Cargo feature is disabled, so generic embedders don't need to sprinklecfg!.PartialConfigfrom the library's public surface;.rdp/PropertySet/ clap / inquire parsing now lives entirely in the viewer and produces aConfigdirectly.