Struct datamodel_renderer::datamodel::EnumVariant
source · pub struct EnumVariant<'a> { /* private fields */ }
Expand description
A variant declaration in an enum block.
Implementations§
source§impl<'a> EnumVariant<'a>
impl<'a> EnumVariant<'a>
sourcepub fn new(name: Cow<'a, str>) -> Self
pub fn new(name: Cow<'a, str>) -> Self
Create a new enum variant to be used in an enum declaration.
ⓘ
enum Foo {
Bar
^^^ value
}
sourcepub fn map(&mut self, value: impl Into<Cow<'a, str>>)
pub fn map(&mut self, value: impl Into<Cow<'a, str>>)
The map attribute of the variant.
ⓘ
enum Foo {
Bar @map("foo")
^^^ this
}
sourcepub fn comment_out(&mut self)
pub fn comment_out(&mut self)
Comments the variant out in the declaration.
ⓘ
enum Foo {
// Bar
^^ adds this
}
Trait Implementations§
source§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>
Auto Trait Implementations§
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