Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Re-export item through intermediate public module where it's not visible
This is mainly an aesthetic issue.
Is it possible to have a pub struct C
defined in a::b::c
where a
and b
are pub
and then re-export C
in a
but C
is not visible in b
?
I want the user of the lib only to be able to access C
through its re-export a::C
, and not via a::b::C
or a::b::c::C
. However, the user may import other members of a::b
like a::b::X
, which is why I need b
to be pub
as well.
3 posts - 2 participants
🏷️ rust_feed