pub struct EmbeddedEnum {
pub id: ModelId,
pub name: Name,
pub discriminant: FieldPrimitive,
pub variants: Vec<EnumVariant>,
pub fields: Vec<Field>,
pub indices: Vec<Index>,
}Fields§
§id: ModelIdUniquely identifies the model within the schema
name: NameName of the model
discriminant: FieldPrimitiveThe primitive type used for the discriminant column
variants: Vec<EnumVariant>The enum’s variants
fields: Vec<Field>All fields across all variants, with global indices. Each field’s
variant field identifies which variant it belongs to.
indices: Vec<Index>Indices defined on this embedded enum’s variant fields.
These reference fields within this embedded enum (not the parent model). The schema builder propagates them to physical DB indexes on the parent table’s flattened columns.
Implementations§
Source§impl EmbeddedEnum
impl EmbeddedEnum
Sourcepub fn has_data_variants(&self) -> bool
pub fn has_data_variants(&self) -> bool
Returns true if at least one variant carries data fields.
Sourcepub fn variant_fields(
&self,
variant_index: usize,
) -> impl Iterator<Item = &Field>
pub fn variant_fields( &self, variant_index: usize, ) -> impl Iterator<Item = &Field>
Returns fields belonging to a specific variant.
Trait Implementations§
Source§impl Clone for EmbeddedEnum
impl Clone for EmbeddedEnum
Source§fn clone(&self) -> EmbeddedEnum
fn clone(&self) -> EmbeddedEnum
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 moreAuto Trait Implementations§
impl Freeze for EmbeddedEnum
impl RefUnwindSafe for EmbeddedEnum
impl Send for EmbeddedEnum
impl Sync for EmbeddedEnum
impl Unpin for EmbeddedEnum
impl UnwindSafe for EmbeddedEnum
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