Struct scale_info::build::VariantBuilder
source · [−]pub struct VariantBuilder<F: Form, S = IndexNotAssigned> { /* private fields */ }Expand description
Build a Variant.
Implementations
sourceimpl<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.
sourceimpl<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.
sourceimpl<S> VariantBuilder<MetaForm, S>
impl<S> VariantBuilder<MetaForm, S>
sourceimpl<F: Form> VariantBuilder<F, IndexAssigned>
impl<F: Form> VariantBuilder<F, IndexAssigned>
Auto Trait Implementations
impl<F, S> RefUnwindSafe for VariantBuilder<F, S>where
S: RefUnwindSafe,
<F as Form>::String: RefUnwindSafe,
<F as Form>::Type: RefUnwindSafe,
impl<F, S> Send for VariantBuilder<F, S>where
S: Send,
<F as Form>::String: Send,
<F as Form>::Type: Send,
impl<F, S> Sync for VariantBuilder<F, S>where
S: Sync,
<F as Form>::String: Sync,
<F as Form>::Type: Sync,
impl<F, S> Unpin for VariantBuilder<F, S>where
S: Unpin,
<F as Form>::String: Unpin,
<F as Form>::Type: Unpin,
impl<F, S> UnwindSafe for VariantBuilder<F, S>where
S: UnwindSafe,
<F as Form>::String: UnwindSafe,
<F as Form>::Type: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more