Decide where enum_dispatch or ambassador would replace hand-written forwarding, and adopt them there. A survey on 2026-09-26 found no site that clearly qualifies, so the likely outcome is closing this with the criteria recorded, unless new code has changed that.
Follow-up to #55 (#146), which moved the catalog and PowerShell cmdlet dispatch onto strum enums. Neither crate applies to those: enum_dispatch forwards a trait's methods to an enum's inner types, and ambassador delegates a trait impl to a field or variant. Both need a trait, and those parses have none.
When each one earns its place
enum_dispatch: a trait with a closed set of implementors, held as Box<dyn Trait> or &dyn Trait on a path where the vtable call or the allocation shows up in a profile.
ambassador: a newtype or enum whose trait impls are several methods of pure forwarding, where adding a method to the trait means editing the forwarder by hand.
Neither buys exhaustiveness. A trait already makes every implementor supply every method, so the gain is boilerplate or speed only.
Candidates found
Tracker (devkit-common/src/tracker/), held as Box<dyn Tracker>. Implementors are GithubTracker, LinearTracker, NoneTracker and FakeTracker. Every call goes to the network or gh, so the vtable cost is noise, and FakeTracker would have to join a production enum or sit behind a cfg-gated variant.
PortProbe, ProcTable (devkit-ports/src/strays/) and Registry (devkit-docs/src/lookup.rs). These are test seams whose other implementors are stubs inside test modules. A closed enum would pull those stubs into non-test code.
LockContext (devkit-docs/src/importers.rs), a two-variant enum over JsContext and TomlContext. Only select forwards uniformly; at_lock_root, member_dirs and rollup do different things per variant. Adopting either crate means inventing a trait for one method.
Replay (devkit-docs/src/importers.rs), a newtype forwarding Display and Error::source. Two short foreign-trait impls, which ambassador handles only through delegatable_trait_remote.
Done when
Each candidate above, plus any trait object or forwarding enum added since, is either converted or listed here with the reason it stays as is.
Decide where
enum_dispatchorambassadorwould replace hand-written forwarding, and adopt them there. A survey on 2026-09-26 found no site that clearly qualifies, so the likely outcome is closing this with the criteria recorded, unless new code has changed that.Follow-up to #55 (#146), which moved the catalog and PowerShell cmdlet dispatch onto
strumenums. Neither crate applies to those:enum_dispatchforwards a trait's methods to an enum's inner types, andambassadordelegates a trait impl to a field or variant. Both need a trait, and those parses have none.When each one earns its place
enum_dispatch: a trait with a closed set of implementors, held asBox<dyn Trait>or&dyn Traiton a path where the vtable call or the allocation shows up in a profile.ambassador: a newtype or enum whose trait impls are several methods of pure forwarding, where adding a method to the trait means editing the forwarder by hand.Neither buys exhaustiveness. A trait already makes every implementor supply every method, so the gain is boilerplate or speed only.
Candidates found
Tracker(devkit-common/src/tracker/), held asBox<dyn Tracker>. Implementors areGithubTracker,LinearTracker,NoneTrackerandFakeTracker. Every call goes to the network orgh, so the vtable cost is noise, andFakeTrackerwould have to join a production enum or sit behind a cfg-gated variant.PortProbe,ProcTable(devkit-ports/src/strays/) andRegistry(devkit-docs/src/lookup.rs). These are test seams whose other implementors are stubs inside test modules. A closed enum would pull those stubs into non-test code.LockContext(devkit-docs/src/importers.rs), a two-variant enum overJsContextandTomlContext. Onlyselectforwards uniformly;at_lock_root,member_dirsandrollupdo different things per variant. Adopting either crate means inventing a trait for one method.Replay(devkit-docs/src/importers.rs), a newtype forwardingDisplayandError::source. Two short foreign-trait impls, whichambassadorhandles only throughdelegatable_trait_remote.Done when
Each candidate above, plus any trait object or forwarding enum added since, is either converted or listed here with the reason it stays as is.