Skip to content

feat(client): gate native backends behind Cargo features and add ConfigBuilder#1338

Draft
Benoît Cortier (CBenoit) wants to merge 2 commits into
masterfrom
refactor/client-split
Draft

feat(client): gate native backends behind Cargo features and add ConfigBuilder#1338
Benoît Cortier (CBenoit) wants to merge 2 commits into
masterfrom
refactor/client-split

Conversation

@CBenoit
Copy link
Copy Markdown
Member

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 cfgs, 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.

…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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and ConfigBuilder in ironrdp-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-viewer to 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.

Comment thread crates/ironrdp-viewer/src/main.rs
Comment thread crates/ironrdp-client/src/rdp.rs Outdated
Comment thread crates/ironrdp-client/src/rdp.rs Outdated
Comment thread crates/ironrdp-client/src/rdp.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants