I have a struct with a constructor that needs to be called from another module in my crate, but that should not be possible to call from outside the crate, while the struct itself and other methods in it needs to be public. Is that possible?
So what I have in my crate is something like this:
I want to put do_wrapped in another module that stuct Context (my actual do_wrapped is a method on another struct). To be able to do that it seems I have to make Context::new public. Is there a way around this?
A private item is still available to all submodules. So a private item in the root of the crate is usable by the whole crate, for example a private function that creates a new Context.