That would only export the Foo module from your lib. So then in an app consuming your lib, you would only have access to Foo.
Note that when I have tried this, it is a bit …wonky. For example, I would still get the auto-complete in vscode for the private modules, but when compiling the code, you get errors about missing modules. (So you could see them, but are not allowed to use them…that may well enough work for you.)
It’s probably just nicer to do something like rescript core and make your “internal” modules prefixed…Core__Blah, Core__Foo, etc. Then coordinate things from the “main” module:
module Blah = Core__Blah
module Foo = Core__Foo
Then just mention your naming strategy to your users about which are “private” or “internal”.
In src_b all the modules in src_a would be visible, not just Foo. Though I suspect that is actually the intended behavior, as I interpret the public to only be affecting how the outside world interacts with the library. Could be something worth mentioning in the docs somewhere though.