pub enum Visibility {
Default,
Hidden,
Protected,
}Expand description
How far a name reaches outside a shared library when nothing in the source said.
-fvisibility=, which is written on every cmake project that cares about its exports and is
the way a library ships a small documented interface instead of every name it happens to
define. The attribute in the source wins wherever one was written, which is what makes the
flag a default rather than an override and what lets -fvisibility=hidden be put on a whole
tree and the dozen exported names marked one at a time.
Three answers to four spellings. internal is hidden plus a promise about never taking the
address across a component boundary, and nothing here derives anything from that promise, so
what it gets is the same symbol with a weaker claim on it.
Variants§
Default
-fvisibility=default. Exported and interposable, which is what a name gets when the flag
is not written at all and what gcc does by default too.
Hidden
-fvisibility=hidden and -fvisibility=internal. Not in the dynamic symbol table.
Protected
-fvisibility=protected. In the dynamic symbol table, and a reference from inside the
library binds to the definition inside it.
Implementations§
Trait Implementations§
Source§impl Clone for Visibility
impl Clone for Visibility
Source§fn clone(&self) -> Visibility
fn clone(&self) -> Visibility
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more