pub struct VariantBuilder { /* private fields */ }Expand description
Builder for a single enum variant.
Implementations§
Source§impl VariantBuilder
impl VariantBuilder
Sourcepub fn field(self, name: impl Into<String>) -> FieldBuilder<Self>
pub fn field(self, name: impl Into<String>) -> FieldBuilder<Self>
Starts a named field inside the variant.
Sourcepub fn unnamed(self) -> FieldBuilder<Self>
pub fn unnamed(self) -> FieldBuilder<Self>
Starts an unnamed field inside the variant.
Sourcepub fn value(self, value: impl Into<String>) -> Self
pub fn value(self, value: impl Into<String>) -> Self
Sets the value for the most recently added annotation.
Sourcepub fn finish_variant(self) -> VariantDefBuilder
pub fn finish_variant(self) -> VariantDefBuilder
Finishes the variant and returns to the enclosing variant builder.
Trait Implementations§
Source§impl Clone for VariantBuilder
impl Clone for VariantBuilder
Source§fn clone(&self) -> VariantBuilder
fn clone(&self) -> VariantBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VariantBuilder
impl Debug for VariantBuilder
Source§impl PushField for VariantBuilder
impl PushField for VariantBuilder
Source§fn push_field(&mut self, field: StructField)
fn push_field(&mut self, field: StructField)
Appends a fully built field to the parent.
Auto Trait Implementations§
impl Freeze for VariantBuilder
impl RefUnwindSafe for VariantBuilder
impl Send for VariantBuilder
impl Sync for VariantBuilder
impl Unpin for VariantBuilder
impl UnsafeUnpin for VariantBuilder
impl UnwindSafe for VariantBuilder
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