pub struct VariantBuilder<F: Form, S = IndexNotAssigned> { /* private fields */ }
Expand description
Build a Variant
.
Implementations§
source§impl<F: Form> VariantBuilder<F, IndexNotAssigned>
impl<F: Form> VariantBuilder<F, IndexNotAssigned>
sourcepub fn new(name: F::String) -> Self
pub fn new(name: F::String) -> Self
Create a new VariantBuilder
.
sourcepub fn index(self, index: u8) -> VariantBuilder<F, IndexAssigned>
pub fn index(self, index: u8) -> VariantBuilder<F, IndexAssigned>
Set the variant’s codec index.
source§impl<F: Form, S> VariantBuilder<F, S>
impl<F: Form, S> VariantBuilder<F, S>
sourcepub fn discriminant(self, discriminant: u64) -> Self
pub fn discriminant(self, discriminant: u64) -> Self
Set the variant’s discriminant.
sourcepub fn fields<T>(self, fields_builder: FieldsBuilder<F, T>) -> Self
pub fn fields<T>(self, fields_builder: FieldsBuilder<F, T>) -> Self
Initialize the variant’s fields.
source§impl<S> VariantBuilder<MetaForm, S>
impl<S> VariantBuilder<MetaForm, S>
source§impl<F: Form> VariantBuilder<F, IndexAssigned>
impl<F: Form> VariantBuilder<F, IndexAssigned>
Auto Trait Implementations§
impl<F, S> Freeze for VariantBuilder<F, S>
impl<F, S> RefUnwindSafe for VariantBuilder<F, S>
impl<F, S> Send for VariantBuilder<F, S>
impl<F, S> Sync for VariantBuilder<F, S>
impl<F, S> Unpin for VariantBuilder<F, S>
impl<F, S> UnwindSafe for VariantBuilder<F, S>
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