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