pub struct EnumTypeBuilder { /* private fields */ }Expand description
Builder for constructing EnumType instances in const contexts.
This builder enables shorter derive macro output by providing a fluent API for constructing enum types with default values for optional fields.
§Example
use facet_core::{EnumTypeBuilder, EnumRepr, Repr, EnumType};
const ENUM: EnumType = EnumTypeBuilder::new(EnumRepr::U8, &[])
.repr(Repr::c())
.build();Implementations§
Source§impl EnumTypeBuilder
impl EnumTypeBuilder
Sourcepub const fn new(enum_repr: EnumRepr, variants: &'static [Variant]) -> Self
pub const fn new(enum_repr: EnumRepr, variants: &'static [Variant]) -> Self
Creates a new EnumTypeBuilder with the required fields.
§Parameters
enum_repr: The representation of the enum’s discriminantvariants: All variants for this enum
Trait Implementations§
Source§impl Clone for EnumTypeBuilder
impl Clone for EnumTypeBuilder
Source§fn clone(&self) -> EnumTypeBuilder
fn clone(&self) -> EnumTypeBuilder
Returns a duplicate of the value. Read more
1.0.0 · 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 EnumTypeBuilder
impl Debug for EnumTypeBuilder
impl Copy for EnumTypeBuilder
Auto Trait Implementations§
impl Freeze for EnumTypeBuilder
impl RefUnwindSafe for EnumTypeBuilder
impl Send for EnumTypeBuilder
impl Sync for EnumTypeBuilder
impl Unpin for EnumTypeBuilder
impl UnwindSafe for EnumTypeBuilder
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