Skip to content

refactor(core): replace wildcard re-exports with explicit lists#1270

Open
Greg Lamberson (glamberson) wants to merge 1 commit into
Devolutions:masterfrom
lamco-admin:refactor/ironrdp-core-explicit-reexports
Open

refactor(core): replace wildcard re-exports with explicit lists#1270
Greg Lamberson (glamberson) wants to merge 1 commit into
Devolutions:masterfrom
lamco-admin:refactor/ironrdp-core-explicit-reexports

Conversation

@glamberson
Copy link
Copy Markdown
Contributor

Summary

crates/ironrdp-core/src/lib.rs currently re-exports each of its nine internal modules via pub use self::foo::*. This PR converts each wildcard to an explicit list of items.

Why

ironrdp-core is the foundational Core Tier crate. Per ARCHITECTURE.md, it is intended to be small and contain only "low-context building blocks" so other crates can depend on it without compile-time cost. The wildcards work against that intent: every new pub fn, pub struct, or pub trait added to any of the eight internal modules is automatically part of ironrdp-core's public API surface, with no review trigger asking whether it should be.

Explicit lists make adding a new pub item a conscious lib.rs edit. The public commitment becomes visible at PR-review time.

What changes

  • pub use self::as_any::* becomes pub use self::as_any::AsAny
  • pub use self::cursor::* becomes an explicit list of three structs
  • pub use self::decode::* becomes an explicit list of nine items (free fns + traits + types)
  • pub use self::encode::* becomes an explicit list of eight items, plus cfg-gated encode_buf (alloc) and encode_vec (alloc or test)
  • pub use self::error::* becomes an explicit list of fourteen items (constructor fns + shape traits)
  • pub use self::into_owned::* becomes pub use self::into_owned::IntoOwned
  • pub use self::padding::* becomes pub use self::padding::{read_padding, write_padding}
  • #[cfg(feature = \"alloc\")] pub use self::write_buf::* becomes #[cfg(feature = \"alloc\")] pub use self::write_buf::WriteBuf

Feature-flag gates preserved exactly.

Behavioural change

None. Every item exported by the wildcards is still exported by name.

Diff

1 file, +24 / -9.

Verification

`cargo xtask check fmt | lints | locks | typos | tests` all pass. `cargo check -p ironrdp-core` builds clean under `--all-features`, `--no-default-features` (no_std), and `--no-default-features --features alloc`. Full workspace `cargo check --workspace --features helper,__bench` builds.

Convert each `pub use self::foo::*` in `crates/ironrdp-core/src/lib.rs`
to an explicit list of items, so adding a new `pub` item to one of the
nine modules requires a conscious lib.rs edit rather than being
auto-public.

This crate is explicitly designed to be the small low-context foundation
for the workspace per ARCHITECTURE.md. Wildcards remove the "is this a
public commitment?" review trigger and let every new pub fn slip into
the API surface without scrutiny. Explicit lists make the public
commitment visible at PR-review time.

Net behavioural change: zero. Every item exported by the wildcards is
still exported by name. Feature-flag gates on encode_buf (alloc),
encode_vec (alloc or test), and WriteBuf (alloc) are preserved.

Verification: cargo xtask check fmt | lints | locks | typos | tests all
pass; cargo check -p ironrdp-core builds clean across all-features,
no-default-features, and alloc-only; full workspace builds with
helper,__bench features.
@glamberson Greg Lamberson (glamberson) force-pushed the refactor/ironrdp-core-explicit-reexports branch from e1d8578 to 3dfe5a9 Compare May 15, 2026 17:42
Greg Lamberson (glamberson) added a commit to lamco-admin/IronRDP that referenced this pull request May 16, 2026
…root

The wildcard `pub use server::*` re-export in lib.rs was replaced with an
explicit list upstream (Devolutions#1270 wildcard cleanup, merged 2026-05-13). The
CredentialValidator commit predated that change, so the rebase onto current
master left the trait defined but not exported.

Adds CredentialValidator to the explicit re-export list so downstream
consumers (e.g., lamco-rdp-server/src/security/auth.rs) can resolve it
via `ironrdp_server::CredentialValidator`.

Folds into PR Devolutions#1172 when the fork retires.
Greg Lamberson (glamberson) added a commit to lamco-admin/IronRDP that referenced this pull request May 16, 2026
Devolutions#1270 (wildcard cleanup) replaced `pub use server::*` with an explicit
re-export list. This PR predates that change, so without an update the
trait would be defined in server.rs but unreachable from downstream
consumers via `ironrdp_server::CredentialValidator`.

Adds CredentialValidator to the explicit list in lib.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.

1 participant