pub enum Visibility {
External(external),
Public(public),
Internal(internal),
Private(private),
}
Expand description
A visibility attribute.
Variants§
External(external)
external
Public(public)
public
Internal(internal)
internal
Private(private)
private
Implementations§
Source§impl Visibility
impl Visibility
Sourcepub fn new_external(span: Span) -> Self
pub fn new_external(span: Span) -> Self
Creates a new External
keyword with the given span
.
Sourcepub fn new_public(span: Span) -> Self
pub fn new_public(span: Span) -> Self
Creates a new Public
keyword with the given span
.
Sourcepub fn new_internal(span: Span) -> Self
pub fn new_internal(span: Span) -> Self
Creates a new Internal
keyword with the given span
.
Sourcepub fn new_private(span: Span) -> Self
pub fn new_private(span: Span) -> Self
Creates a new Private
keyword with the given span
.
pub fn parse_opt(input: ParseStream<'_>) -> Result<Option<Self>>
pub fn peek(lookahead: &Lookahead1<'_>) -> bool
pub const fn as_str(self) -> &'static str
pub const fn as_debug_str(self) -> &'static str
Sourcepub const fn is_external(self) -> bool
pub const fn is_external(self) -> bool
Returns true if self
matches Self::External
.
Sourcepub const fn is_internal(self) -> bool
pub const fn is_internal(self) -> bool
Returns true if self
matches Self::Internal
.
Sourcepub const fn is_private(self) -> bool
pub const fn is_private(self) -> bool
Returns true if self
matches Self::Private
.
Trait Implementations§
Source§impl Clone for Visibility
impl Clone for Visibility
Source§fn clone(&self) -> Visibility
fn clone(&self) -> Visibility
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Visibility
impl Debug for Visibility
Source§impl Display for Visibility
impl Display for Visibility
Source§impl Hash for Visibility
impl Hash for Visibility
Source§impl Parse for Visibility
impl Parse for Visibility
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for Visibility
impl PartialEq for Visibility
Source§impl Spanned for Visibility
impl Spanned for Visibility
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.impl Copy for Visibility
impl Eq 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)