pub struct InheritanceInfo {
pub strategy: InheritanceStrategy,
pub parent: Option<&'static str>,
pub discriminator_column: Option<&'static str>,
pub discriminator_value: Option<&'static str>,
}Expand description
Inheritance metadata for a model.
This struct captures the inheritance configuration for models that participate in table inheritance hierarchies.
Fields§
§strategy: InheritanceStrategyThe inheritance strategy for this model.
parent: Option<&'static str>The parent model name (for child models).
When set, this model inherits from the specified parent model.
discriminator_column: Option<&'static str>The discriminator column name (for single table inheritance base models).
For single table inheritance, this specifies which column contains the type discriminator values that distinguish between different model types.
discriminator_value: Option<&'static str>The discriminator value for this model (single table inheritance child).
For single table inheritance, this value is stored in the discriminator column to identify rows belonging to this specific model type.
Implementations§
Source§impl InheritanceInfo
impl InheritanceInfo
Sourcepub const fn single_table() -> Self
pub const fn single_table() -> Self
Create inheritance info for a base model with single table inheritance.
Sourcepub const fn joined_table() -> Self
pub const fn joined_table() -> Self
Create inheritance info for a base model with joined table inheritance.
Sourcepub const fn concrete_table() -> Self
pub const fn concrete_table() -> Self
Create inheritance info for a base model with concrete table inheritance.
Sourcepub const fn with_discriminator_column(self, column: &'static str) -> Self
pub const fn with_discriminator_column(self, column: &'static str) -> Self
Set the discriminator column name (builder pattern, for base models).
Sourcepub const fn with_discriminator_value(self, value: &'static str) -> Self
pub const fn with_discriminator_value(self, value: &'static str) -> Self
Set the discriminator value (builder pattern, for child models).
Trait Implementations§
Source§impl Clone for InheritanceInfo
impl Clone for InheritanceInfo
Source§fn clone(&self) -> InheritanceInfo
fn clone(&self) -> InheritanceInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more