I'm trying to create a "internal implementation only" solution using generics and traits.
The logic works fine but it seems I can't export the "wrapper" struct that uses the internal implementations sort of as-needed without making those implementation structs also fully public.
Error is error: type lib123::internal::ImplementorCrateOnly is private in main on line 6
I'm not sure why this doesn't allow keeping the ImplementorCrateOnly as crate-only given there are no entry-points to allow accessing the value behind the ImplementorCrateOnly type anywhere inside VisibleToUsers
Any public signature cannot contain something that's private anywhere in it. I'm actually surprised that this impl even shows up in rustdoc.
You can freely make things pub in modules that are inaccessible to users, and it will accomplish approximately what you're trying to do. (users can't name them unless they happen to appear as an associated type somewhere, and they won't get a page in the docs)
Oh I see so if I have a private mod I can freely use pub for the contents as needed by the "top level" wrappers. I thought if I make things pub it'd be visible by users.