moved all code into sealed:: mod to make API tagging possible #987
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The whole zenoh library API is present in lib.rs file with "pub use" reexports. No file mods are public.
This allows to overview all the API from single file. But this works one direction only. I.e. structure/trait/function belongs to API if it's declared in public module in lib.rs. But it's impossible to say is some structure/function/method public by just looking at it's definition itself. Even if it's
pub(crate)
it still can be reexported by lib.rs.This may cause inconveniences when reading code. Also, which is more important, this breaks logic of tagging tool https://github.com/zettaScaleLabs/api-matrix. It needs explicit
pub
declarations for interface items, so the fact thatpub(crate)
instances still can be part of interface makes it's diagnostics incorrect.This update removes
pub(crate)
statements replacing them topub(in crate::sealed)
. Unlikepub(crate)
thepub(in crate::sealed)
can't be reexported because the lib.rs don't have access to them. This forces us to explicitly mark all interface elements aspub
. I.e. if something belongs to API it should be both reexported in lib.rs and marked aspub
in the source.The usage of
pub(crate)
should be avoided as this doesn't explicitly state if item belongs to API or not.