pub struct EnumVariant<'a> { /* private fields */ }Expand description
A single variant in an enum type definition.
Implementations§
Source§impl<'a> EnumVariant<'a>
impl<'a> EnumVariant<'a>
Sourcepub const fn new(name: &'a str, comments: &'a [&'a Comment<'a>]) -> Self
pub const fn new(name: &'a str, comments: &'a [&'a Comment<'a>]) -> Self
Creates a new enum variant with the given name and borrowed comments.
Sourcepub fn new_owned(name: &'a str, comments: Vec<Comment<'a>>) -> Self
pub fn new_owned(name: &'a str, comments: Vec<Comment<'a>>) -> Self
Creates a new enum variant with the given name and owned comments.
Sourcepub fn comments(&self) -> impl Iterator<Item = &Comment<'a>>
pub fn comments(&self) -> impl Iterator<Item = &Comment<'a>>
Returns an iterator over the comments associated with this variant.
Sourcepub fn has_comments(&self) -> bool
pub fn has_comments(&self) -> bool
Returns true if this variant has any comments.
Trait Implementations§
Source§impl<'a> Clone for EnumVariant<'a>
impl<'a> Clone for EnumVariant<'a>
Source§fn clone(&self) -> EnumVariant<'a>
fn clone(&self) -> EnumVariant<'a>
Returns a duplicate 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<'a> Debug for EnumVariant<'a>
impl<'a> Debug for EnumVariant<'a>
Source§impl<'a> Display for EnumVariant<'a>
impl<'a> Display for EnumVariant<'a>
Source§impl<'a> PartialEq for EnumVariant<'a>
impl<'a> PartialEq for EnumVariant<'a>
impl<'a> Eq for EnumVariant<'a>
Auto Trait Implementations§
impl<'a> Freeze for EnumVariant<'a>
impl<'a> RefUnwindSafe for EnumVariant<'a>
impl<'a> Send for EnumVariant<'a>
impl<'a> Sync for EnumVariant<'a>
impl<'a> Unpin for EnumVariant<'a>
impl<'a> UnwindSafe for EnumVariant<'a>
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