Private inner module returning private item gives “private type in public interface” error
问题 In the below example, the module outer has a private type Private and a private inner module inner . inner is able to access Private (because child modules can access their parent's private items , even if they are not parked as public). inner defines a function not_really_public_interface() . While it is marked as public, it is really only available to outer because inner itself is not public. outer.rs struct Private; mod inner { use super::Private; pub fn not_really_public_interface() ->