Struct scale_info::build::Variants
source · [−]Expand description
Builds a definition of a variant type i.e an enum
Implementations
sourceimpl<F: Form> Variants<F>
impl<F: Form> Variants<F>
sourcepub fn variant<B>(self, name: F::String, builder: B) -> Selfwhere
B: Fn(VariantBuilder<F>) -> VariantBuilder<F, IndexAssigned>,
pub fn variant<B>(self, name: F::String, builder: B) -> Selfwhere
B: Fn(VariantBuilder<F>) -> VariantBuilder<F, IndexAssigned>,
Add a variant
sourcepub fn variant_unit(self, name: F::String, index: u8) -> Self
pub fn variant_unit(self, name: F::String, index: u8) -> Self
Add a unit variant (without fields).
sourcepub fn finalize(self) -> TypeDefVariant<F>
pub fn finalize(self) -> TypeDefVariant<F>
Construct a new TypeDefVariant from the initialized builder variants.
Trait Implementations
Auto Trait Implementations
impl<F> RefUnwindSafe for Variants<F>where
<F as Form>::String: RefUnwindSafe,
<F as Form>::Type: RefUnwindSafe,
impl<F> Send for Variants<F>where
<F as Form>::String: Send,
<F as Form>::Type: Send,
impl<F> Sync for Variants<F>where
<F as Form>::String: Sync,
<F as Form>::Type: Sync,
impl<F> Unpin for Variants<F>where
<F as Form>::String: Unpin,
<F as Form>::Type: Unpin,
impl<F> UnwindSafe for Variants<F>where
<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