#[non_exhaustive]pub enum Visibility {
Inherited,
Public(Pub),
Crate(VisibilityRestrict<Crate>),
Super(VisibilityRestrict<Super>),
SelfValue(VisibilityRestrict<SelfValue>),
In(VisibilityRestrict<VisibilityIn>),
}
Expand description
Visibility level restricted to some path.
pub(self)
.pub(super)
.pub(crate)
.pub(in some::module)
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Inherited
An inherited visibility level, this usually means private.
Public(Pub)
An unrestricted public visibility level: pub
.
Crate(VisibilityRestrict<Crate>)
Crate visibility pub(crate)
.
Super(VisibilityRestrict<Super>)
Super visibility pub(super)
.
SelfValue(VisibilityRestrict<SelfValue>)
Self visibility pub(self)
.
In(VisibilityRestrict<VisibilityIn>)
In visibility pub(in path)
.
Implementations§
Source§impl Visibility
impl Visibility
Trait Implementations§
Source§impl Debug for Visibility
impl Debug for Visibility
Source§impl Default for Visibility
impl Default for Visibility
Source§impl OptionSpanned for Visibility
impl OptionSpanned for Visibility
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Get the optional span of the type.
Source§impl Parse for Visibility
impl Parse for Visibility
Source§impl PartialEq for Visibility
impl PartialEq for Visibility
Source§impl ToTokens for Visibility
impl ToTokens for Visibility
Source§fn to_tokens(
&self,
context: &mut MacroContext<'_, '_, '_>,
stream: &mut TokenStream,
) -> Result<()>
fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>
Turn the current item into tokens.
Source§impl TryClone for Visibility
impl TryClone for Visibility
impl Eq for Visibility
impl StructuralPartialEq for Visibility
Auto Trait Implementations§
impl Freeze for Visibility
impl RefUnwindSafe for Visibility
impl Send for Visibility
impl Sync for Visibility
impl Unpin for Visibility
impl UnwindSafe for Visibility
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.